Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTomasz Maczukin <tomasz@maczukin.pl>2017-02-08 01:08:02 +0300
committerTomasz Maczukin <tomasz@maczukin.pl>2017-03-01 15:29:52 +0300
commite9f83c4bd9d6b596d647f9347d0014b3ab2cca3e (patch)
treea3f1df8b5e7474d67a401ed89ba1a3342ae4b6dc /app/workers
parent0ba385b363879f270c767aab6c1799a8e675a263 (diff)
Add Gitlab::OptimisticLocking for build dropping
Diffstat (limited to 'app/workers')
-rw-r--r--app/workers/stuck_ci_builds_worker.rb4
1 files changed, 3 insertions, 1 deletions
diff --git a/app/workers/stuck_ci_builds_worker.rb b/app/workers/stuck_ci_builds_worker.rb
index 4eba311d063..3b18fe3dd26 100644
--- a/app/workers/stuck_ci_builds_worker.rb
+++ b/app/workers/stuck_ci_builds_worker.rb
@@ -47,6 +47,8 @@ class StuckCiBuildsWorker
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})"
- build.drop
+ Gitlab::OptimisticLocking.retry_lock(build, 3) do |b|
+ b.drop
+ end
end
end