From 079ce3d974d61544cba5ded8e9b8436f1c7c431e Mon Sep 17 00:00:00 2001 From: Dorian Niemiec Date: Mon, 11 Sep 2023 21:50:42 +0200 Subject: [PATCH] Reposition some if conditions --- svr.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/svr.js b/svr.js index 4e6a310..c49a4ec 100644 --- a/svr.js +++ b/svr.js @@ -338,7 +338,7 @@ function SVRJSFork() { // Fork new worker var newWorker = {}; try { - if (cluster.__shimmed__ && process.isBun && process.versions.bun && process.versions.bun[0] != "0" && !threadLimitWarned) { + if (!threadLimitWarned && cluster.__shimmed__ && process.isBun && process.versions.bun && process.versions.bun[0] != "0") { threadLimitWarned = true; serverconsole.locwarnmessage("SVR.JS limited the number of workers to one, because of startup problems in Bun 1.0 and newer with shimmed (not native) clustering module. Reliability may suffer."); } @@ -351,7 +351,7 @@ function SVRJSFork() { if(err.name == "NotImplementedError") { // If cluster.fork throws a NotImplementedError, shim cluster module cluster.bunShim(); - if (cluster.__shimmed__ && process.isBun && process.versions.bun && process.versions.bun[0] != "0" && !threadLimitWarned) { + if (!threadLimitWarned && cluster.__shimmed__ && process.isBun && process.versions.bun && process.versions.bun[0] != "0") { threadLimitWarned = true; serverconsole.locwarnmessage("SVR.JS limited the number of workers to one, because of startup problems in Bun 1.0 and newer with shimmed (not native) clustering module. Reliability may suffer."); } @@ -1293,6 +1293,7 @@ if (!fs.existsSync(__dirname + "/config.json")) { } var certificateError = null; + // Load SNI if (secure) { try {