From d519493ec6a0a7f1abebc75e860ba92b1998bdf9 Mon Sep 17 00:00:00 2001 From: lyncir Date: Fri, 16 Oct 2020 16:52:51 +0800 Subject: [PATCH] fixed: not only TimeoutError will retry, ConnectionError will also --- aredis/client.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/aredis/client.py b/aredis/client.py index 91973db5..4eaebb41 100644 --- a/aredis/client.py +++ b/aredis/client.py @@ -160,10 +160,10 @@ async def execute_command(self, *args, **options): raise except (ConnectionError, TimeoutError) as e: connection.disconnect() - if not connection.retry_on_timeout and isinstance(e, TimeoutError): - raise - await connection.send_command(*args) - return await self.parse_response(connection, command_name, **options) + if connection.retry_on_timeout and isinstance(e, TimeoutError): + await connection.send_command(*args) + return await self.parse_response(connection, command_name, **options) + raise finally: pool.release(connection)