Skip to content

Commit

Permalink
redis cache bug; loop through key matches to delete them since
Browse files Browse the repository at this point in the history
@redis.srem doesn't support splatted arrays yet
  • Loading branch information
ckrailo committed Jan 9, 2012
1 parent bc7a2bd commit 1dc1417
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/harbor/cache/redis.rb
Expand Up @@ -54,6 +54,9 @@ def delete_matching(key_regex)
if (matches = keys_matching(key_regex)).empty? if (matches = keys_matching(key_regex)).empty?
nil nil
else else
matches.each do |match|
@redis.srem(TRACKER_KEY_NAME, match)
end
@redis.srem(TRACKER_KEY_NAME, *matches) @redis.srem(TRACKER_KEY_NAME, *matches)
@redis.del(*matches) @redis.del(*matches)
end end
Expand Down

0 comments on commit 1dc1417

Please sign in to comment.