2012-11-08 21:39:42 +00:00
|
|
|
module AbfWorker
|
2012-12-11 15:25:25 +00:00
|
|
|
class IsoWorkerObserver < AbfWorker::BaseObserver
|
2012-11-08 21:39:42 +00:00
|
|
|
@queue = :iso_worker_observer
|
|
|
|
|
|
|
|
def self.perform(options)
|
2013-02-05 18:49:26 +00:00
|
|
|
new(options, ProductBuildList).perform
|
|
|
|
end
|
|
|
|
|
|
|
|
def perform
|
2012-12-06 19:18:28 +00:00
|
|
|
case status
|
2012-12-13 12:30:37 +00:00
|
|
|
when COMPLETED
|
2013-02-05 18:49:26 +00:00
|
|
|
subject.build_success
|
2012-12-13 12:30:37 +00:00
|
|
|
when FAILED
|
2015-03-03 21:04:37 +00:00
|
|
|
|
|
|
|
case options['exit_status'].to_i
|
|
|
|
when ProductBuildList::BUILD_COMPLETED_PARTIALLY
|
|
|
|
subject.build_success_partially
|
|
|
|
else
|
|
|
|
subject.build_error
|
|
|
|
end
|
|
|
|
|
2012-12-13 12:30:37 +00:00
|
|
|
when STARTED
|
2013-02-05 18:49:26 +00:00
|
|
|
subject.start_build
|
2012-12-13 12:30:37 +00:00
|
|
|
when CANCELED
|
2013-02-05 18:49:26 +00:00
|
|
|
subject.build_canceled
|
2012-12-06 19:18:28 +00:00
|
|
|
end
|
2013-02-05 18:49:26 +00:00
|
|
|
update_results if status != STARTED
|
2012-11-08 21:39:42 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
end
|