mirror of
https://github.com/discourse/discourse.git
synced 2024-11-23 02:19:27 +08:00
FIX: Update word_watcher cache key following schema change (#17755)
862007fb18
introduced a change to the format that watched words are cached in Redis. Newly-deployed versions of the app were attempting to load the old-format data from Redis, leading to a server error. This commit introduces a CACHE_VERSION constant which we can easily bump when making changes to the cache schema.
This commit is contained in:
parent
4bf9b73296
commit
381365facc
|
@ -2,6 +2,7 @@
|
|||
|
||||
class WordWatcher
|
||||
REPLACEMENT_LETTER ||= CGI.unescape_html("■")
|
||||
CACHE_VERSION = 2
|
||||
|
||||
def initialize(raw)
|
||||
@raw = raw
|
||||
|
@ -105,7 +106,7 @@ class WordWatcher
|
|||
end
|
||||
|
||||
def self.word_matcher_regexp_key(action)
|
||||
"watched-words-list:#{action}"
|
||||
"watched-words-list:v#{CACHE_VERSION}:#{action}"
|
||||
end
|
||||
|
||||
def self.censor(html)
|
||||
|
|
Loading…
Reference in New Issue
Block a user