aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support/cache/redis_cache_store.rb
diff options
context:
space:
mode:
Diffstat (limited to 'activesupport/lib/active_support/cache/redis_cache_store.rb')
-rw-r--r--activesupport/lib/active_support/cache/redis_cache_store.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/activesupport/lib/active_support/cache/redis_cache_store.rb b/activesupport/lib/active_support/cache/redis_cache_store.rb
index 95f8f639e8..a05718b663 100644
--- a/activesupport/lib/active_support/cache/redis_cache_store.rb
+++ b/activesupport/lib/active_support/cache/redis_cache_store.rb
@@ -264,7 +264,7 @@ module ActiveSupport
failsafe :increment do
redis.with do |c|
val = c.incrby key, amount
- if expires_in > 0 && c.ttl(key) == -2
+ if expires_in > 0 && c.ttl(key) < 0
c.expire key, expires_in
end
val
@@ -290,7 +290,7 @@ module ActiveSupport
failsafe :decrement do
redis.with do |c|
val = c.decrby key, amount
- if expires_in > 0 && c.ttl(key) == -2
+ if expires_in > 0 && c.ttl(key) < 0
c.expire key, expires_in
end
val