Skip to content

Instantly share code, notes, and snippets.

@mikecmpbll
Created April 8, 2014 10:10
Show Gist options
  • Save mikecmpbll/10106651 to your computer and use it in GitHub Desktop.
Save mikecmpbll/10106651 to your computer and use it in GitHub Desktop.
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