2012-11-08 21:39:42 +00:00
|
|
|
module AbfWorker
|
2012-12-11 15:25:25 +00:00
|
|
|
class IsoWorkerObserver < AbfWorker::BaseObserver
|
2016-05-28 19:21:02 +01:00
|
|
|
sidekiq_options :queue => :iso_worker_observer
|
2012-11-08 21:39:42 +00:00
|
|
|
|
2016-05-28 19:21:02 +01:00
|
|
|
def real_perform
|
|
|
|
@subject_class = ProductBuildList
|
2019-02-10 14:15:46 +00:00
|
|
|
return if !subject
|
2016-05-28 19:21:02 +01:00
|
|
|
subject.with_lock do
|
|
|
|
case status
|
|
|
|
when COMPLETED
|
|
|
|
subject.build_success
|
|
|
|
when FAILED
|
2013-02-05 18:49:26 +00:00
|
|
|
|
2016-05-28 19:21:02 +01:00
|
|
|
case options['exit_status'].to_i
|
|
|
|
when ProductBuildList::BUILD_COMPLETED_PARTIALLY
|
|
|
|
subject.build_success_partially
|
|
|
|
else
|
|
|
|
subject.build_error
|
|
|
|
end
|
2015-03-03 21:04:37 +00:00
|
|
|
|
2016-05-28 19:21:02 +01:00
|
|
|
when STARTED
|
|
|
|
subject.start_build
|
|
|
|
when CANCELED
|
|
|
|
subject.build_canceled
|
2015-03-03 21:04:37 +00:00
|
|
|
end
|
2016-05-28 19:21:02 +01:00
|
|
|
update_results if status != STARTED
|
2012-12-06 19:18:28 +00:00
|
|
|
end
|
2012-11-08 21:39:42 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
end
|