mirror of
https://github.com/samsonjs/rack-attack.git
synced 2026-03-25 09:25:49 +00:00
fix: Fix redis-rb 4.6.0 deprecation warnings
Redis 4.6.0 deprecated calling commands on `Redis` inside `#pipelined`:
redis.pipelined do
redis.get("key")
end
The above should be:
redis.pipelined do |pipeline|
pipeline.get("key")
end
See: https://github.com/redis/redis-rb/pull/1059
This commit is contained in:
parent
82181325bc
commit
c01208afe6
1 changed files with 3 additions and 3 deletions
|
|
@ -32,9 +32,9 @@ module Rack
|
|||
|
||||
def increment(key, amount, options = {})
|
||||
rescuing do
|
||||
pipelined do
|
||||
incrby(key, amount)
|
||||
expire(key, options[:expires_in]) if options[:expires_in]
|
||||
pipelined do |redis|
|
||||
redis.incrby(key, amount)
|
||||
redis.expire(key, options[:expires_in]) if options[:expires_in]
|
||||
end.first
|
||||
end
|
||||
end
|
||||
|
|
|
|||
Loading…
Reference in a new issue