diff options
author | Sean Carroll <scarroll@gitlab.com> | 2019-09-02 11:44:52 +0300 |
---|---|---|
committer | Sean Carroll <scarroll@gitlab.com> | 2019-09-02 13:59:30 +0300 |
commit | 6889196116140577e2bce62be0a7784dbfa6e4ff (patch) | |
tree | 6a4c98e26fbd9999d708f4927144c30e37f2ed8a /lib/gitlab/optimistic_locking.rb | |
parent | 937b2027041e6d1f2aad1b62af107c0768f4a6f2 (diff) |
Backport EE issue 12996
Diffstat (limited to 'lib/gitlab/optimistic_locking.rb')
-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) |