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

optimistic_locking.rb « gitlab « lib - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 7668c518bc5320bf8fc7086fc5270cf7e8005de4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
module Gitlab
  module OptimisticLocking
    def retry_lock(subject, &block)
      while true do
        begin
          return yield subject
        rescue StaleObjectError
          subject.reload
        end
      end
    end
  end
end