DEV: Clear all DistributedCache on Redis fallback.

This commit is contained in:
Guo Xiang Tan 2020-09-18 11:17:54 +08:00
parent a957a980e2
commit d83d9ec408
No known key found for this signature in database
GPG Key ID: FBD110179AAC1F20

View File

@ -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