From cbf965db714a3d66b8eb882e7b689f44e3f41282 Mon Sep 17 00:00:00 2001 From: Jean Boussier Date: Tue, 2 Apr 2024 16:50:43 +0200 Subject: [PATCH] Eagerly close subscribed connection Fix: https://github.com/redis/redis-rb/issues/1259 Otherwise we need to wait for GC to close it. --- lib/redis.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/redis.rb b/lib/redis.rb index c6b8f7003..286585ee9 100644 --- a/lib/redis.rb +++ b/lib/redis.rb @@ -175,6 +175,7 @@ def _subscription(method, timeout, channels, block) @subscription_client.send(method, *channels, &block) end ensure + @subscription_client&.close @subscription_client = nil end else