mirror of
https://github.com/discourse/discourse.git
synced 2025-05-23 22:51:06 +08:00
DEV: Reduce duplication with DistributedMutex#clear_regex (#25795)
This commit is contained in:

committed by
GitHub

parent
bf7470e93b
commit
087712c1a6
@ -47,4 +47,8 @@ class DistributedCache < MessageBus::DistributedCache
|
||||
super()
|
||||
end
|
||||
end
|
||||
|
||||
def clear_regex(regex)
|
||||
hash.keys.select { |k| k =~ regex }.each { |k| delete(k) }
|
||||
end
|
||||
end
|
||||
|
Reference in New Issue
Block a user