diff options
author | Sean Carroll <scarroll@gitlab.com> | 2019-09-02 10:44:52 +0200 |
---|---|---|
committer | Sean Carroll <scarroll@gitlab.com> | 2019-09-02 12:59:30 +0200 |
commit | 6889196116140577e2bce62be0a7784dbfa6e4ff (patch) | |
tree | 6a4c98e26fbd9999d708f4927144c30e37f2ed8a /lib | |
parent | 937b2027041e6d1f2aad1b62af107c0768f4a6f2 (diff) | |
download | gitlab-ce-ce-12996-cancel-redundant-pipelines.tar.gz |
Backport EE issue 12996ce-12996-cancel-redundant-pipelines
Diffstat (limited to 'lib')
-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) |