mirror of
https://github.com/discourse/discourse.git
synced 2025-09-06 10:50:21 +08:00
minor cleanup to previous commit from code review
This commit is contained in:
parent
5302709343
commit
e0e6dae6a7
2 changed files with 6 additions and 4 deletions
|
@ -22,10 +22,12 @@ class DistributedMutex
|
|||
|
||||
while !try_to_get_lock
|
||||
sleep 0.001
|
||||
attempts += 1
|
||||
# in readonly we will never be able to get a lock
|
||||
if @using_global_redis && attempts > CHECK_READONLY_ATTEMPT
|
||||
raise Discourse::ReadOnly
|
||||
if @using_global_redis
|
||||
attempts += 1
|
||||
if attempts > CHECK_READONLY_ATTEMPT
|
||||
raise Discourse::ReadOnly
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue