DEV: Don't blow up request redis can't be reached during failover.

DEV: Don’t blow up request redis can’t be reached during failover.

diff --git a/config/initializers/002-rails_failover.rb b/config/initializers/002-rails_failover.rb
index 54692b7..a48b3dd 100644
--- a/config/initializers/002-rails_failover.rb
+++ b/config/initializers/002-rails_failover.rb
@@ -65,9 +65,14 @@ if ENV["ACTIVE_RECORD_RAILS_FAILOVER"]
   end
 
   RailsFailover::ActiveRecord.register_force_reading_role_callback do
-    Discourse.redis.exists(
-      Discourse::PG_READONLY_MODE_KEY,
-      Discourse::PG_FORCE_READONLY_MODE_KEY
-    )
+    begin
+      Discourse.redis.exists?(
+        Discourse::PG_READONLY_MODE_KEY,
+        Discourse::PG_FORCE_READONLY_MODE_KEY
+      )
+    rescue => e
+      Discourse.warn_exception(e)
+      false
+    end
   end
 end

GitHub sha: cbb4ea1e