From f794c25f608ecacabf0388da3bccdb32126f1fb2 Mon Sep 17 00:00:00 2001 From: Guo Xiang Tan Date: Wed, 30 Nov 2016 16:38:21 +0800 Subject: [PATCH] FIX: Ensure a Thread is always running. --- .../connection_adapters/postgresql_fallback_adapter.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/active_record/connection_adapters/postgresql_fallback_adapter.rb b/lib/active_record/connection_adapters/postgresql_fallback_adapter.rb index 03932d6cc75..c901213ee7d 100644 --- a/lib/active_record/connection_adapters/postgresql_fallback_adapter.rb +++ b/lib/active_record/connection_adapters/postgresql_fallback_adapter.rb @@ -101,6 +101,8 @@ module ActiveRecord config = config.symbolize_keys if fallback_handler.master_down? + fallback_handler.verify_master + connection = postgresql_connection(config.dup.merge({ host: config[:replica_host], port: config[:replica_port] }))