From 34f8ac2d8570eb2e7a3e18899c23d3fd53e60b3f Mon Sep 17 00:00:00 2001 From: 0xbyt4 <35742124+0xbyt4@users.noreply.github.com> Date: Mon, 9 Mar 2026 17:16:26 +0300 Subject: [PATCH] fix: replace blocking time.sleep with await asyncio.sleep in WhatsApp connect time.sleep(1) inside async def connect() blocks the entire event loop for 1 second. Replaced with await asyncio.sleep(1) to yield control back to the event loop while waiting for the killed port process to release. --- gateway/platforms/whatsapp.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gateway/platforms/whatsapp.py b/gateway/platforms/whatsapp.py index 285a89eef..00675f2ae 100644 --- a/gateway/platforms/whatsapp.py +++ b/gateway/platforms/whatsapp.py @@ -181,8 +181,8 @@ class WhatsAppAdapter(BasePlatformAdapter): # Kill any orphaned bridge from a previous gateway run _kill_port_process(self._bridge_port) - import time - time.sleep(1) + import asyncio + await asyncio.sleep(1) # Start the bridge process in its own process group. # Route output to a log file so QR codes, errors, and reconnection