From 1a4e8f70415e073db257c4a31908c21e9921dd5b Mon Sep 17 00:00:00 2001 From: liuhao1024 <11816344+liuhao1024@users.noreply.github.com> Date: Tue, 12 May 2026 18:49:00 -0700 Subject: [PATCH] fix(gateway): make WhatsApp npm install timeout configurable Default timeout raised from 60s to 300s (5 minutes) to accommodate slower systems like Unraid NAS. Configurable via WHATSAPP_NPM_INSTALL_TIMEOUT environment variable. --- gateway/platforms/whatsapp.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/gateway/platforms/whatsapp.py b/gateway/platforms/whatsapp.py index 2fb6fc13329..29b78d75d01 100644 --- a/gateway/platforms/whatsapp.py +++ b/gateway/platforms/whatsapp.py @@ -494,12 +494,15 @@ class WhatsAppAdapter(BasePlatformAdapter): # plain executable path. _npm_bin = shutil.which("npm") or "npm" try: + # Read timeout from environment variable, default to 300 seconds (5 minutes) + # to accommodate slower systems like Unraid NAS + npm_install_timeout = int(os.environ.get("WHATSAPP_NPM_INSTALL_TIMEOUT", "300")) install_result = subprocess.run( [_npm_bin, "install", "--silent"], cwd=str(bridge_dir), capture_output=True, text=True, - timeout=60, + timeout=npm_install_timeout, ) if install_result.returncode != 0: print(f"[{self.name}] npm install failed: {install_result.stderr}")