Commit e9f83c4b authored by Tomasz Maczukin's avatar Tomasz Maczukin

Add Gitlab::OptimisticLocking for build dropping

parent 0ba385b3
...@@ -47,6 +47,8 @@ class StuckCiBuildsWorker ...@@ -47,6 +47,8 @@ class StuckCiBuildsWorker
def drop_build(type, build, status, timeout) def drop_build(type, build, status, timeout)
Rails.logger.info "#{self.class}: Dropping #{type} build #{build.id} for runner #{build.runner_id} (status: #{status}, timeout: #{timeout})" Rails.logger.info "#{self.class}: Dropping #{type} build #{build.id} for runner #{build.runner_id} (status: #{status}, timeout: #{timeout})"
build.drop Gitlab::OptimisticLocking.retry_lock(build, 3) do |b|
b.drop
end
end end
end end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment