Skip to content

Commit

Permalink
Fix build error on invalid build list, reset builder on restart
Browse files Browse the repository at this point in the history
  • Loading branch information
DuratarskeyK committed Mar 26, 2019
1 parent 3243bbb commit ef27578
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions app/jobs/abf_worker/rpm_worker_observer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@ def real_perform
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

Expand Down Expand Up @@ -80,6 +79,7 @@ def restart_task
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
Expand All @@ -96,4 +96,4 @@ def fill_container_data
end

end
end
end

0 comments on commit ef27578

Please sign in to comment.