DEV: Reduce duplication with DistributedMutex#clear_regex (#25795)

This commit is contained in:
Daniel Waterworth
2024-02-21 14:19:04 -06:00
committed by GitHub
parent bf7470e93b
commit 087712c1a6
3 changed files with 9 additions and 9 deletions

View File

@ -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