File tree Expand file tree Collapse file tree 2 files changed +3
-7
lines changed Expand file tree Collapse file tree 2 files changed +3
-7
lines changed Original file line number Diff line number Diff line change 1010from redis .asyncio .lock import Lock
1111from redis .asyncio .retry import Retry
1212from redis .backoff import ExponentialBackoff
13- from servicelib .async_utils import cancel_wait_task
14- from servicelib .background_task import periodic
1513
14+ from ..async_utils import cancel_wait_task
15+ from ..background_task import periodic
1616from ..logging_utils import log_catch
1717from ._constants import (
1818 DEFAULT_DECODE_RESPONSES ,
@@ -35,7 +35,6 @@ class RedisClientSDK:
3535 _client : aioredis .Redis = field (init = False )
3636 _health_check_task : Task | None = None
3737 _is_healthy : bool = False
38- _continue_health_checking : bool = True
3938
4039 @property
4140 def redis (self ) -> aioredis .Redis :
@@ -76,11 +75,9 @@ async def _periodic_check_health() -> None:
7675
7776 async def shutdown (self ) -> None :
7877 if self ._health_check_task :
79- self ._continue_health_checking = False
8078 await cancel_wait_task (
8179 self ._health_check_task , max_delay = SHUTDOWN_TIMEOUT_S
8280 )
83- self ._health_check_task = None
8481
8582 await self ._client .aclose (close_connection_pool = True )
8683
Original file line number Diff line number Diff line change @@ -24,10 +24,9 @@ async def test_redis_client_sdk_lost_connection(
2424 redis_service .build_redis_dsn (RedisDatabase .RESOURCES ), client_name = "pytest"
2525 )
2626 assert redis_client_sdk .client_name == "pytest"
27- await redis_client_sdk .setup ()
2827
2928 assert await redis_client_sdk .ping () is True
30- # now let's put down the rabbit service
29+ # no connection available any longer should not hang but timeout
3130 for rabbit_docker_service in (
3231 docker_service
3332 for docker_service in docker_client .services .list ()
You can’t perform that action at this time.
0 commit comments