From 986c8833275caa2d97d8f802efbb675d5f89bdcf Mon Sep 17 00:00:00 2001 From: Dorian Niemiec Date: Thu, 10 Aug 2023 04:20:30 +0200 Subject: [PATCH] Improve Bun fake IPC connections error handling. --- svr.js | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/svr.js b/svr.js index bb86e66..8aba699 100644 --- a/svr.js +++ b/svr.js @@ -282,14 +282,8 @@ if (!singlethreaded) { fakeWorkerIPCConnection.end(message); }); } catch (err) { - if (tries > 25) { - newWorker.emit("error", err); - return; - } - - setTimeout(function () { - newWorker.send(message, fakeParam2, fakeParam3, fakeParam4, tries + 1); - }, 10); + if (tries > 50) throw err; + newWorker.send(message, fakeParam2, fakeParam3, fakeParam4, tries + 1); } }; }