DEV: Add force rails_over switch via Redis.

DEV: Add force rails_over switch via Redis.

diff --git a/config/initializers/002-rails_failover.rb b/config/initializers/002-rails_failover.rb
index e4bb24e..d3249d6 100644
--- a/config/initializers/002-rails_failover.rb
+++ b/config/initializers/002-rails_failover.rb
@@ -11,7 +11,14 @@ if ENV["ACTIVE_RECORD_RAILS_FAILOVER"]
     Sidekiq.unpause!
   end
 
+  module Discourse
+    PG_FORCE_READONLY_MODE_KEY ||= 'readonly_mode:postgres_force'
+  end
+
   RailsFailover::ActiveRecord.register_force_reading_role_callback do
-    Discourse.pg_readonly_mode?
+    Discourse.redis.exists(
+      Discourse::PG_READONLY_MODE_KEY,
+      Discourse::PG_FORCE_READONLY_MODE_KEY
+    )
   end
 end

GitHub sha: b0b37bf5