Skip to content

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

FIX: Be more aggressive in checking master when trying to fallback.

Guo Xiang Tan2adae2a0b69b
diff --git a/lib/active_record/connection_adapters/postgresql_fallback_adapter.rb b/lib/active_record/connection_adapters/postgresql_fallback_adapter.rb
index 509468d5475..3491f1ce896 100644
--- a/lib/active_record/connection_adapters/postgresql_fallback_adapter.rb
+++ b/lib/active_record/connection_adapters/postgresql_fallback_adapter.rb
@@ -33,7 +33,7 @@ class PostgreSQLFallbackHandler
thread = Thread.new { initiate_fallback_to_master }
thread.join
break if synchronize { @masters_down.hash.empty? }
- sleep 10
+ sleep 5
end
end
diff --git a/lib/discourse_redis.rb b/lib/discourse_redis.rb
index 800acd4980d..00647242b84 100644
--- a/lib/discourse_redis.rb
+++ b/lib/discourse_redis.rb
@@ -27,7 +27,7 @@ class DiscourseRedis
thread = Thread.new { initiate_fallback_to_master }
thread.join
break if synchronize { @master }
- sleep 10
+ sleep 5
ensure
thread.kill
end