diff options
author | Lin Jen-Shin <godfat@godfat.org> | 2019-09-03 09:31:58 +0300 |
---|---|---|
committer | Lin Jen-Shin <godfat@godfat.org> | 2019-09-03 09:31:58 +0300 |
commit | abd9e842720fc434c643cfe3f1662923c92f68f3 (patch) | |
tree | 2af7e16240c559b83f25e86968214f38590aea4f /lib/gitlab | |
parent | 991143eb1f1bb5cda1f709ad44fdc021aa12b75d (diff) | |
parent | 6889196116140577e2bce62be0a7784dbfa6e4ff (diff) |
Merge branch 'ce-12996-cancel-redundant-pipelines' into 'master'
Backport retries options for cancel_running
See merge request gitlab-org/gitlab-ce!32525
Diffstat (limited to 'lib/gitlab')
-rw-r--r-- | lib/gitlab/optimistic_locking.rb | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/gitlab/optimistic_locking.rb b/lib/gitlab/optimistic_locking.rb index 0c0f46d3b77..d51d718c826 100644 --- a/lib/gitlab/optimistic_locking.rb +++ b/lib/gitlab/optimistic_locking.rb @@ -4,7 +4,8 @@ module Gitlab module OptimisticLocking module_function - def retry_lock(subject, retries = 100, &block) + def retry_lock(subject, retries = nil, &block) + retries ||= 100 # TODO(Observability): We should be recording details of the number of retries and the duration of the total execution here ActiveRecord::Base.transaction do yield(subject) |