Created
April 8, 2014 10:10
-
-
Save mikecmpbll/10106651 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module ActiveSupport | |
module Cache | |
class RedisStore | |
def delete(key, options = nil) | |
options = merged_options(options) | |
instrument(:delete_matched, key.inspect) do |payload| | |
delete_matched(namespaced_key(key, options), options) | |
end | |
end | |
def delete_matched(matcher, options = nil) | |
options = merged_options(options) | |
matcher = key_matcher(matcher, options) | |
keys = @data.keys(matcher) | |
instrument(:delete_matched, matcher.inspect) do | |
begin | |
keys.present? && @data.del(*keys) | |
rescue Errno::ECONNREFUSED => e | |
false | |
end | |
end | |
end | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment