Skip to content

A platform for community discussion. Free, open, simple.

FIX: correct readonly timeout

Same0be5145cf57
diff --git a/lib/distributed_mutex.rb b/lib/distributed_mutex.rb
index aac583e3a7e..d47f059d0fd 100644
--- a/lib/distributed_mutex.rb
+++ b/lib/distributed_mutex.rb
@@ -23,7 +23,7 @@ class DistributedMutex
while !try_to_get_lock
sleep 0.001
# in readonly we will never be able to get a lock
- if @using_global_redis
+ if @using_global_redis && Discourse.recently_readonly?
attempts += 1
if attempts > CHECK_READONLY_ATTEMPT
raise Discourse::ReadOnly