From a58432384c7b48eeb388e9bdea723f6c35e8b4a8 Mon Sep 17 00:00:00 2001 From: triumph1 Date: Sun, 2 Oct 2022 18:15:06 +0900 Subject: [PATCH] raise when error is TimeoutError, retry when ConnectionError --- aioredis/client.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/aioredis/client.py b/aioredis/client.py index 9b4e1a3d3..5bdbd0f3f 100644 --- a/aioredis/client.py +++ b/aioredis/client.py @@ -1104,7 +1104,7 @@ async def execute_command(self, *args, **options): return await self.parse_response(conn, command_name, **options) except (ConnectionError, TimeoutError) as e: await conn.disconnect() - if not (conn.retry_on_timeout and isinstance(e, TimeoutError)): + if isinstance(e, TimeoutError) and not conn.retry_on_timeout: raise await conn.send_command(*args) return await self.parse_response(conn, command_name, **options)