Skip build_lists for red3 platfrom
This commit is contained in:
parent
de7b60fac2
commit
bee08c01cf
|
@ -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
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue