FIX: correct readonly timeout
So it only applies in readonly mode
This commit is contained in:
parent
ad74eea50d
commit
fd8bf5d2cb
@ -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 && Discourse.recently_readonly?
|
||||
attempts += 1
|
||||
if attempts > CHECK_READONLY_ATTEMPT
|
||||
raise Discourse::ReadOnly
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user