DEV: Disable messageBus keepalive when Redis fails over.

DEV: Disable messageBus keepalive when Redis fails over.

diff --git a/config/initializers/002-rails_failover.rb b/config/initializers/002-rails_failover.rb
index 383dca3..72df0c9 100644
--- a/config/initializers/002-rails_failover.rb
+++ b/config/initializers/002-rails_failover.rb
@@ -1,13 +1,18 @@
 # frozen_string_literal: true
 
 if ENV["REDIS_RAILS_FAILOVER"]
+  message_bus_keepalive_interval = nil
+
   RailsFailover::Redis.on_failover do
+    message_bus_keepalive_interval = MessageBus.keepalive_interval
+    MessageBus.keepalive_interval = -1 # Disable MessageBus keepalive_interval
     Discourse.received_redis_readonly!
   end
 
   RailsFailover::Redis.on_fallback do
     Discourse.clear_readonly!
     Discourse.request_refresh!
+    MessageBus.keepalive_interval = message_bus_keepalive_interval
   end
 end
 

GitHub sha: f6628e4f