FIX: Force ActiveRecord reading role if Redis is down.

FIX: Force ActiveRecord reading role if Redis is down.

diff --git a/config/initializers/002-rails_failover.rb b/config/initializers/002-rails_failover.rb
index 0ec3857..7b948c0 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

GitHub sha: f03c7a1b

1 Like