From ef275786cf0c154fdd7d17c8754ce3e79b7e9019 Mon Sep 17 00:00:00 2001 From: Wedge Date: Tue, 26 Mar 2019 09:39:50 +0300 Subject: [PATCH] Fix build error on invalid build list, reset builder on restart --- app/jobs/abf_worker/rpm_worker_observer.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/jobs/abf_worker/rpm_worker_observer.rb b/app/jobs/abf_worker/rpm_worker_observer.rb index 1ca36b83b..779041f04 100644 --- a/app/jobs/abf_worker/rpm_worker_observer.rb +++ b/app/jobs/abf_worker/rpm_worker_observer.rb @@ -21,8 +21,7 @@ module AbfWorker fill_container_data if status != STARTED unless subject.valid? - subject.build_error(false) - subject.save(validate: false) + subject.update_attribute(:status, BuildList::BUILD_ERROR) return end @@ -80,6 +79,7 @@ module AbfWorker else Redis.current.lpush RESTARTED_BUILD_LISTS, subject.id subject.update_column(:status, BuildList::BUILD_PENDING) + subject.update_column(:builder_id, nil) return true end end @@ -96,4 +96,4 @@ module AbfWorker end end -end \ No newline at end of file +end