forked from svrjs/svrjs
Disable bug workaround for Bun 1.0 and newer (it's not needed anymore for these Bun versions)
This commit is contained in:
parent
b39471e8b8
commit
24783fc1f9
2 changed files with 3 additions and 3 deletions
|
@ -3,7 +3,7 @@
|
||||||
"port": 80,
|
"port": 80,
|
||||||
"pubport": 80,
|
"pubport": 80,
|
||||||
"page404": "404.html",
|
"page404": "404.html",
|
||||||
"timestamp": 1694365030044,
|
"timestamp": 1694365365939,
|
||||||
"blacklist": [],
|
"blacklist": [],
|
||||||
"nonStandardCodes": [],
|
"nonStandardCodes": [],
|
||||||
"enableCompression": true,
|
"enableCompression": true,
|
||||||
|
|
4
svr.js
4
svr.js
|
@ -1449,7 +1449,7 @@ if (!disableMods) {
|
||||||
|
|
||||||
// Define the temporary server-side JavaScript file name
|
// Define the temporary server-side JavaScript file name
|
||||||
var tempServerSideScriptName = "serverSideScript.js";
|
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
|
// 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";
|
tempServerSideScriptName = ".serverSideScript_w" + Math.floor(Math.random() * 65536) + ".js";
|
||||||
}
|
}
|
||||||
|
@ -5575,7 +5575,7 @@ if (cluster.isPrimary || cluster.isPrimary === undefined) {
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
// Error!
|
// Error!
|
||||||
}
|
}
|
||||||
if (process.isBun) {
|
if (process.isBun && process.versions.bun && process.versions.bun[0] == "0") {
|
||||||
try {
|
try {
|
||||||
fs.writeFileSync(__dirname + "/temp/serverSideScript.js", "// Placeholder server-side JavaScript to workaround Bun bug.\r\n");
|
fs.writeFileSync(__dirname + "/temp/serverSideScript.js", "// Placeholder server-side JavaScript to workaround Bun bug.\r\n");
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
|
|
Reference in a new issue