diff --git a/lib/abf_worker/rpm_worker_observer.rb b/lib/abf_worker/rpm_worker_observer.rb index 5ca55aaf8..cc0167b88 100644 --- a/lib/abf_worker/rpm_worker_observer.rb +++ b/lib/abf_worker/rpm_worker_observer.rb @@ -7,24 +7,24 @@ module AbfWorker bl = BuildList.find options['id'] status = options['status'].to_i - unless restart_task(bl, status, options) - item = find_or_create_item(bl) - fill_container_data(bl, options) if status != STARTED + return if restart_task(bl, status, options) + + item = find_or_create_item(bl) + fill_container_data(bl, options) if status != STARTED - case status - when COMPLETED - bl.build_success - item.update_attributes({:status => BuildList::SUCCESS}) - bl.now_publish if bl.auto_publish? - when FAILED - bl.build_error - item.update_attributes({:status => BuildList::BUILD_ERROR}) - when STARTED - bl.start_build - when CANCELED - bl.build_canceled - item.update_attributes({:status => BuildList::BUILD_CANCELED}) - end + case status + when COMPLETED + bl.build_success + item.update_attributes({:status => BuildList::SUCCESS}) + bl.now_publish if bl.auto_publish? + when FAILED + bl.build_error + item.update_attributes({:status => BuildList::BUILD_ERROR}) + when STARTED + bl.start_build + when CANCELED + bl.build_canceled + item.update_attributes({:status => BuildList::BUILD_CANCELED}) end end