mirror of
https://github.com/discourse/discourse.git
synced 2025-02-20 23:19:25 +08:00
FIX: Cache all watched words (#14992)
It used to cache up to 1000 words, but the maximum number of watched word is 2000.
This commit is contained in:
parent
bf34d3524b
commit
186379adac
@ -8,7 +8,10 @@ class WordWatcher
|
||||
end
|
||||
|
||||
def self.words_for_action(action)
|
||||
words = WatchedWord.where(action: WatchedWord.actions[action.to_sym]).limit(1000)
|
||||
words = WatchedWord
|
||||
.where(action: WatchedWord.actions[action.to_sym])
|
||||
.limit(WatchedWord::MAX_WORDS_PER_ACTION)
|
||||
|
||||
if WatchedWord.has_replacement?(action.to_sym)
|
||||
words.pluck(:word, :replacement).to_h
|
||||
else
|
||||
|
Loading…
x
Reference in New Issue
Block a user