@raevon/n8n-nodes-whatsapp 2.0.4 → 2.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -344,9 +344,21 @@ async function startServer(cfg) {
|
|
|
344
344
|
}
|
|
345
345
|
async function ensureServerRunning(cfg) {
|
|
346
346
|
const port = getPort(cfg);
|
|
347
|
-
|
|
347
|
+
// Port is free — start server
|
|
348
|
+
if (await isPortOpen(port)) {
|
|
348
349
|
await startServer(cfg);
|
|
350
|
+
return;
|
|
351
|
+
}
|
|
352
|
+
// Port is in use — server already running, just verify it responds
|
|
353
|
+
try {
|
|
354
|
+
const res = await fetch(`http://127.0.0.1:${port}/health`, { signal: AbortSignal.timeout(3000) });
|
|
355
|
+
if (res.ok)
|
|
356
|
+
return; // Server alive, use it
|
|
349
357
|
}
|
|
358
|
+
catch { }
|
|
359
|
+
// Port in use but not responding — this is a stale/zombie process we can't kill
|
|
360
|
+
// Don't try to start another server, just report the issue
|
|
361
|
+
throw new Error(`Port ${port} is in use but server not responding. Restart n8n to clear stale processes.`);
|
|
350
362
|
}
|
|
351
363
|
async function disconnect() { }
|
|
352
364
|
async function getWhatsAppCredentials(credentials) {
|
package/package.json
CHANGED