Skip build_lists for red3 platfrom

This commit is contained in:
Vokhmin Alexey V 2013-11-29 16:58:37 +04:00
parent de7b60fac2
commit bee08c01cf
3 changed files with 12 additions and 3 deletions

View File

@ -15,10 +15,13 @@ class Api::V1::JobsController < Api::V1::BaseController
build_lists = build_lists.for_platform(platform_ids) if platform_ids.present?
if current_user.system?
# Temporally
# if task = Resque.pop('rpm_worker')
if task = (Resque.pop('rpm_worker_default') || Resque.pop('rpm_worker'))
@build_list = BuildList.where(:id => task['args'][0]['id']).first
# Temporally
if @build_list.build_for_platform.name == 'red3'
@build_list.restart_job
@build_list = nil
end
end
end

View File

@ -28,6 +28,12 @@ module AbfWorker::ModelHelper
)
end
def restart_job
redis = Resque.redis
redis.lpush "queue:#{worker_queue_with_priority}",
Resque.encode({'class' => worker_queue_class, 'args' => [abf_worker_args]})
end
def cancel_job
if destroy_from_resque_queue == 1
build_canceled

View File

@ -59,7 +59,7 @@ module AbfWorker
else
redis.lpush RESTARTED_BUILD_LISTS, subject.id
subject.update_column(:status, BuildList::BUILD_PENDING)
subject.add_job_to_abf_worker_queue if subject.external_nodes.blank?
subject.restart_job if subject.external_nodes.blank?
return true
end
end