From 1423037a579aec356a966eec8aa3af4a6244b9f0 Mon Sep 17 00:00:00 2001 From: zhousheng06 Date: Thu, 12 Dec 2024 20:11:29 +0800 Subject: [PATCH] Fix incorrect attribute reuse --- redis/connection.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/redis/connection.py b/redis/connection.py index 40f2d29722..4f8b82b71f 100644 --- a/redis/connection.py +++ b/redis/connection.py @@ -870,9 +870,11 @@ def read_response( and self._cache.get(self._current_command_cache_key).status != CacheEntryStatus.IN_PROGRESS ): - return copy.deepcopy( + res = copy.deepcopy( self._cache.get(self._current_command_cache_key).cache_value ) + self._current_command_cache_key = None + return res response = self._conn.read_response( disable_decoding=disable_decoding, @@ -898,6 +900,8 @@ def read_response( cache_entry.cache_value = response self._cache.set(cache_entry) + self._current_command_cache_key = None + return response def pack_command(self, *args):