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)
|
|
|
|
status = options['status'].to_i
|
|
|
|
pbl = ProductBuildList.find options['id']
|
2012-12-06 19:18:28 +00:00
|
|
|
case status
|
2012-12-13 12:30:37 +00:00
|
|
|
when COMPLETED
|
2012-12-06 19:18:28 +00:00
|
|
|
pbl.build_success
|
2012-12-13 12:30:37 +00:00
|
|
|
when FAILED
|
2012-12-06 19:18:28 +00:00
|
|
|
pbl.build_error
|
2012-12-13 12:30:37 +00:00
|
|
|
when STARTED
|
2012-12-06 19:18:28 +00:00
|
|
|
pbl.start_build
|
2012-12-13 12:30:37 +00:00
|
|
|
when CANCELED
|
2012-12-06 19:18:28 +00:00
|
|
|
pbl.build_canceled
|
|
|
|
end
|
2012-12-13 12:30:37 +00:00
|
|
|
if status != STARTED
|
2012-12-11 11:47:32 +00:00
|
|
|
update_results(pbl, options)
|
2012-12-06 19:18:28 +00:00
|
|
|
end
|
2012-11-08 21:39:42 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
end
|