From f03c7a1ba1cf3876c46690a2e20891b61f7cd819 Mon Sep 17 00:00:00 2001 From: Guo Xiang Tan Date: Thu, 9 Jul 2020 11:13:02 +0800 Subject: [PATCH] FIX: Force ActiveRecord reading role if Redis is down. --- config/initializers/002-rails_failover.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/config/initializers/002-rails_failover.rb b/config/initializers/002-rails_failover.rb index 0ec3857adf7..7b948c0bd7e 100644 --- a/config/initializers/002-rails_failover.rb +++ b/config/initializers/002-rails_failover.rb @@ -57,8 +57,9 @@ if defined?(RailsFailover::ActiveRecord) rescue => e unless e.is_a?(Redis::CannotConnectError) Rails.logger.warn "#{e.class} #{e.message}: #{e.backtrace.join("\n")}" + true + else + false end - - false end end