From c0b0c66a9e043ff905be0b202127b385616f8e30 Mon Sep 17 00:00:00 2001 From: Guo Xiang Tan Date: Mon, 11 Jun 2018 15:22:59 +0800 Subject: [PATCH] FIX: PostgreSQL fallback thread doesn't run server starts in readonly. --- .../connection_adapters/postgresql_fallback_adapter.rb | 5 ++++- 1 file changed, 4 insertions(+), 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 24fa8260a0d..509468d5475 100644 --- a/lib/active_record/connection_adapters/postgresql_fallback_adapter.rb +++ b/lib/active_record/connection_adapters/postgresql_fallback_adapter.rb @@ -57,7 +57,10 @@ class PostgreSQLFallbackHandler end def initiate_fallback_to_master - return unless @initialized + unless @initialized + @initialized = true + return + end @masters_down.hash.keys.each do |key| RailsMultisite::ConnectionManagement.with_connection(key) do