Permalink
Browse files

Update matcher to work if 0 is returned for cache key

  • Loading branch information...
jgadbois committed May 23, 2013
1 parent 30ab62d commit 35812518fea55cc59a036c90f0e2f315bcb8d594
Showing with 2 additions and 2 deletions.
  1. +2 −2 lib/soulmate/matcher.rb
View
@@ -13,7 +13,7 @@ def matches_for_term(term, options = {})
cachekey = "#{cachebase}:" + words.join('|')
- if !options[:cache] || !Soulmate.redis.exists(cachekey)
+ if !options[:cache] || !Soulmate.redis.exists(cachekey) || Soulmate.redis.exists(cachekey) == 0
interkeys = words.map { |w| "#{base}:#{w}" }
Soulmate.redis.zinterstore(cachekey, interkeys)
Soulmate.redis.expire(cachekey, 10 * 60) # expire after 10 minutes
@@ -29,4 +29,4 @@ def matches_for_term(term, options = {})
end
end
end
-end
+end

0 comments on commit 3581251

Please sign in to comment.