We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 326bb1c commit 6d886d7Copy full SHA for 6d886d7
redis/asyncio/client.py
@@ -702,6 +702,11 @@ async def reset(self):
702
self.pending_unsubscribe_patterns = set()
703
704
def close(self) -> Awaitable[NoReturn]:
705
+ # In case a connection property does not yet exist
706
+ # (due to a crash earlier in the Redis() constructor), return
707
+ # immediately as there is nothing to clean-up.
708
+ if not hasattr(self, "connection"):
709
+ return
710
return self.reset()
711
712
async def on_connect(self, connection: Connection):
0 commit comments