Skip to content

Commit 3723208

Browse files
committed
fixed shutdown
1 parent 1d2bf81 commit 3723208

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

packages/service-library/src/servicelib/redis/_clients_manager.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import asyncio
12
from dataclasses import dataclass, field
23

34
from settings_library.redis import RedisDatabase, RedisSettings
@@ -28,10 +29,10 @@ async def setup(self) -> None:
2829
)
2930

3031
async def shutdown(self) -> None:
31-
# NOTE: somehow using logged_gather is not an option
32-
# doing so will make the shutdown procedure hang
33-
for client in self._client_sdks.values():
34-
await client.shutdown()
32+
await asyncio.gather(
33+
*[client.shutdown() for client in self._client_sdks.values()],
34+
return_exceptions=True,
35+
)
3536

3637
def client(self, database: RedisDatabase) -> RedisClientSDK:
3738
return self._client_sdks[database]

0 commit comments

Comments
 (0)