Skip to content

Commit

Permalink
fix: Fix redis-rb 4.6.0 deprecation warnings
Browse files Browse the repository at this point in the history
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: redis/redis-rb#1059
  • Loading branch information
ixti committed Feb 4, 2022
1 parent 8218132 commit c01208a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/rack/attack/store_proxy/redis_proxy.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ def write(key, value, options = {})

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
Expand Down

0 comments on commit c01208a

Please sign in to comment.