Skip to content

Commit dded008

Browse files
author
mingsing
committed
wait for Dapr health check asynchronously
Switch Dapr health check from blocking call to async call to avoid blocking the event loop in async environments Signed-off-by: mingsing <[email protected]>
1 parent f959cd5 commit dded008

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

dapr/aio/clients/grpc/subscription.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,8 @@ async def outgoing_request_iterator():
5151

5252
async def reconnect_stream(self):
5353
await self.close()
54-
DaprHealth.wait_until_ready()
54+
loop = asyncio.get_event_loop()
55+
await loop.run_in_executor(None, DaprHealth.wait_until_ready)
5556
print('Attempting to reconnect...')
5657
await self.start()
5758

0 commit comments

Comments
 (0)