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
+1 -5
View File
@@ -20,11 +20,7 @@ class ApplicationSerializer < ActiveModel::Serializer
when String
fragment_cache.delete(name_or_regexp)
when Regexp
fragment_cache
.hash
.keys
.select { |k| k =~ name_or_regexp }
.each { |k| fragment_cache.delete(k) }
fragment_cache.clear_regex(name_or_regexp)
end
end