DEV: Clear all `DistributedCache` on Redis fallback.

DEV: Clear all DistributedCache on Redis fallback.

diff --git a/config/initializers/002-rails_failover.rb b/config/initializers/002-rails_failover.rb
index 87a48be..a8973bd 100644
--- a/config/initializers/002-rails_failover.rb
+++ b/config/initializers/002-rails_failover.rb
@@ -13,6 +13,10 @@ if defined?(RailsFailover::Redis)
     Discourse.clear_redis_readonly!
     Discourse.request_refresh!
     MessageBus.keepalive_interval = message_bus_keepalive_interval
+
+    ObjectSpace.each_object(DistributedCache) do |cache|
+      cache.clear
+    end
   end
 
   if Rails.logger.respond_to? :chained

GitHub sha: d83d9ec4