mirror of
https://github.com/langbot-app/LangBot.git
synced 2026-07-16 09:26:07 +00:00
fix(dingtalk): avoid blocking event loop on connection open (#2337)
This commit is contained in:
@@ -885,7 +885,10 @@ class DingTalkClient:
|
||||
|
||||
while not self._stopped:
|
||||
try:
|
||||
connection = self.client.open_connection()
|
||||
# open_connection performs blocking network I/O in the DingTalk SDK.
|
||||
# Run it off the event loop so connection stalls do not block the
|
||||
# LangBot HTTP server and other async tasks.
|
||||
connection = await asyncio.to_thread(self.client.open_connection)
|
||||
|
||||
if not connection:
|
||||
if self.logger:
|
||||
|
||||
Reference in New Issue
Block a user