DEV: Force ActiveRecord reading role on Redis failover.

DEV: Force ActiveRecord reading role on Redis failover.

diff --git a/config/initializers/002-rails_failover.rb b/config/initializers/002-rails_failover.rb
index 5214e69..f471c72 100644
--- a/config/initializers/002-rails_failover.rb
+++ b/config/initializers/002-rails_failover.rb
@@ -55,6 +55,9 @@ if defined?(RailsFailover::ActiveRecord)
     Discourse.redis.exists?(
       Discourse::PG_READONLY_MODE_KEY,
       Discourse::PG_FORCE_READONLY_MODE_KEY
+    ) || (
+      GlobalSetting.redis_config[:replica_port] &&
+      Discourse.redis.connection[:port] == GlobalSetting.redis_config[:replica_port]
     )
   rescue => e
     if e.is_a?(Redis::CannotConnectError)

GitHub sha: 5adf2cca