mirror of
https://github.com/discourse/discourse.git
synced 2025-05-28 13:39:28 +08:00
FIX: Cache keys should be strings (#25791)
* FIX: Cache keys should be strings Otherwise, there are subtle bugs that don't show up with a single process.
This commit is contained in:

committed by
GitHub

parent
428db40deb
commit
13291dc5ef
@ -14,6 +14,8 @@ class DistributedCache < MessageBus::DistributedCache
|
||||
end
|
||||
|
||||
def defer_get_set(k, &block)
|
||||
raise TypeError if !Rails.env.production? && !k.is_a?(String)
|
||||
|
||||
return self[k] if hash.key? k
|
||||
value = block.call
|
||||
self.defer_set(k, value)
|
||||
|
Reference in New Issue
Block a user