mirror of
https://github.com/gitlabhq/gitlabhq.git
synced 2025-08-01 16:46:16 +00:00
14 lines
239 B
Ruby
14 lines
239 B
Ruby
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
|