From 24783fc1f9a48cd80ffca799281230c21021eb23 Mon Sep 17 00:00:00 2001 From: Dorian Niemiec Date: Sun, 10 Sep 2023 19:03:28 +0200 Subject: [PATCH] Disable bug workaround for Bun 1.0 and newer (it's not needed anymore for these Bun versions) --- config.json | 2 +- svr.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/config.json b/config.json index 0a7efab..f52cc9f 100644 --- a/config.json +++ b/config.json @@ -3,7 +3,7 @@ "port": 80, "pubport": 80, "page404": "404.html", - "timestamp": 1694365030044, + "timestamp": 1694365365939, "blacklist": [], "nonStandardCodes": [], "enableCompression": true, diff --git a/svr.js b/svr.js index a0bd9b0..e5979c3 100644 --- a/svr.js +++ b/svr.js @@ -1449,7 +1449,7 @@ if (!disableMods) { // Define the temporary server-side JavaScript file name var tempServerSideScriptName = "serverSideScript.js"; - if (!process.isBun && cluster.isPrimary === false) { + if (!(process.isBun && process.versions.bun && process.versions.bun[0] == "0") && cluster.isPrimary === false) { // If not the master process and it's not Bun, create a unique temporary server-side JavaScript file name for each worker tempServerSideScriptName = ".serverSideScript_w" + Math.floor(Math.random() * 65536) + ".js"; } @@ -5575,7 +5575,7 @@ if (cluster.isPrimary || cluster.isPrimary === undefined) { } catch (err) { // Error! } - if (process.isBun) { + if (process.isBun && process.versions.bun && process.versions.bun[0] == "0") { try { fs.writeFileSync(__dirname + "/temp/serverSideScript.js", "// Placeholder server-side JavaScript to workaround Bun bug.\r\n"); } catch (err) {