FIX: Switch recently readonly mdoe cache to a `DistributedCache`.

A per process cache is hard to reason about. During PostgreSQL
failovers. The site may bounce in and out of readonly mode depending on
which server and process that a request hits.
This commit is contained in:
Guo Xiang Tan 2018-12-17 13:28:36 +08:00
parent 704a122656
commit e75ad37aaf
1 changed files with 1 additions and 1 deletions

View File

@ -354,7 +354,7 @@ module Discourse
end
def self.last_read_only
@last_read_only ||= {}
@last_read_only ||= DistributedCache.new('last_read_only', namespace: false)
end
def self.recently_readonly?