From c7adea14ce05e8357d2feab1b2299e9f07bfedbb Mon Sep 17 00:00:00 2001 From: Vokhmin Alexey V Date: Tue, 27 Nov 2012 14:59:47 +0400 Subject: [PATCH] fix the tasks duplication --- app/models/build_list.rb | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/app/models/build_list.rb b/app/models/build_list.rb index 156eb0f3a..6ce3b1df6 100644 --- a/app/models/build_list.rb +++ b/app/models/build_list.rb @@ -268,11 +268,13 @@ class BuildList < ActiveRecord::Base # :update_type => update_type, # :priority => priority, } - Resque.push( - 'rpm_worker', - 'class' => 'AbfWorker::RpmWorker', - 'args' => [options] - ) + unless @status + Resque.push( + 'rpm_worker', + 'class' => 'AbfWorker::RpmWorker', + 'args' => [options] + ) + end @status ||= BUILD_PENDING #XML-RPC params: project_name, project_version, plname, arch, bplname, update_type, build_requires, id_web, include_repos, priority, git_project_address # @status ||= BuildServer.add_build_list project.name, project_version, save_to_platform.name, arch.name, (save_to_platform_id == build_for_platform_id ? '' : build_for_platform.name), update_type, build_requires, id, include_repos, priority, project.git_project_address