Skip to content

Commit 1423037

Browse files
author
zhousheng06
committed
Fix incorrect attribute reuse
1 parent 9d5751d commit 1423037

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

redis/connection.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -870,9 +870,11 @@ def read_response(
870870
and self._cache.get(self._current_command_cache_key).status
871871
!= CacheEntryStatus.IN_PROGRESS
872872
):
873-
return copy.deepcopy(
873+
res = copy.deepcopy(
874874
self._cache.get(self._current_command_cache_key).cache_value
875875
)
876+
self._current_command_cache_key = None
877+
return res
876878

877879
response = self._conn.read_response(
878880
disable_decoding=disable_decoding,
@@ -898,6 +900,8 @@ def read_response(
898900
cache_entry.cache_value = response
899901
self._cache.set(cache_entry)
900902

903+
self._current_command_cache_key = None
904+
901905
return response
902906

903907
def pack_command(self, *args):

0 commit comments

Comments
 (0)