File tree Expand file tree Collapse file tree 1 file changed +6
-5
lines changed
packages/service-library/src/servicelib/redis Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -89,9 +89,6 @@ async def shutdown(self) -> None:
8989 _logger , level = logging .DEBUG , msg = f"Shutdown RedisClientSDK { self } "
9090 ):
9191 if self ._health_check_task :
92- assert self ._health_check_task_started_event # nosec
93- # NOTE: wait for the health check task to have started once before we can cancel it
94- await self ._health_check_task_started_event .wait ()
9592 await cancel_wait_task (
9693 self ._health_check_task , max_delay = _HEALTHCHECK_TASK_TIMEOUT_S
9794 )
@@ -101,8 +98,12 @@ async def shutdown(self) -> None:
10198 async def ping (self ) -> bool :
10299 with log_catch (_logger , reraise = False ):
103100 # NOTE: retry_* input parameters from aioredis.from_url do not apply for the ping call
104- await self ._client .ping ()
105- return True
101+ try :
102+ await self ._client .ping ()
103+ return True
104+ except (redis .exceptions .TimeoutError , redis .exceptions .ConnectionError ):
105+ pass
106+
106107 return False
107108
108109 @property
You can’t perform that action at this time.
0 commit comments