From c7402ef794d07883ad38f5791eaaab9c9774517f Mon Sep 17 00:00:00 2001 From: Guo Xiang Tan Date: Fri, 20 Oct 2017 05:45:09 +0800 Subject: [PATCH] FIX: Use a distributed cache to store failover state. --- .../connection_adapters/postgresql_fallback_adapter.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/active_record/connection_adapters/postgresql_fallback_adapter.rb b/lib/active_record/connection_adapters/postgresql_fallback_adapter.rb index 5dc5f2278ec..af45125adc2 100644 --- a/lib/active_record/connection_adapters/postgresql_fallback_adapter.rb +++ b/lib/active_record/connection_adapters/postgresql_fallback_adapter.rb @@ -7,7 +7,7 @@ class PostgreSQLFallbackHandler include Singleton def initialize - @masters_down = {} + @masters_down = DistributedCache.new('masters_down') @mutex = Mutex.new end