From c01208afe69b52e34e164dbb7fc2988384b827d0 Mon Sep 17 00:00:00 2001 From: Alexey Zapparov Date: Fri, 4 Feb 2022 21:14:00 +0100 Subject: [PATCH] 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 --- lib/rack/attack/store_proxy/redis_proxy.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/rack/attack/store_proxy/redis_proxy.rb b/lib/rack/attack/store_proxy/redis_proxy.rb index 3127de63..830d39de 100644 --- a/lib/rack/attack/store_proxy/redis_proxy.rb +++ b/lib/rack/attack/store_proxy/redis_proxy.rb @@ -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