forked from svrjs/svrjs
Reposition some if conditions
This commit is contained in:
parent
68e7fa9ae6
commit
079ce3d974
1 changed files with 3 additions and 2 deletions
5
svr.js
5
svr.js
|
@ -338,7 +338,7 @@ function SVRJSFork() {
|
||||||
// Fork new worker
|
// Fork new worker
|
||||||
var newWorker = {};
|
var newWorker = {};
|
||||||
try {
|
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;
|
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.");
|
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(err.name == "NotImplementedError") {
|
||||||
// If cluster.fork throws a NotImplementedError, shim cluster module
|
// If cluster.fork throws a NotImplementedError, shim cluster module
|
||||||
cluster.bunShim();
|
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;
|
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.");
|
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;
|
var certificateError = null;
|
||||||
|
|
||||||
// Load SNI
|
// Load SNI
|
||||||
if (secure) {
|
if (secure) {
|
||||||
try {
|
try {
|
||||||
|
|
Reference in a new issue