1
0
Fork 0
forked from svrjs/svrjs

fix: fix the cluster limit of one process for Deno with shimmed clustering module

This commit is contained in:
Dorian Niemiec 2024-10-18 21:01:51 +02:00
parent 63d3f5df32
commit 38cf8bb68d

View file

@ -1436,16 +1436,26 @@ function SVRJSFork() {
((process.isBun &&
process.versions.bun &&
process.versions.bun[0] != "0") ||
(process.versions && process.versions.deno_)) &&
(process.versions && process.versions.deno)) &&
Object.keys(cluster.workers) > 0
)
) {
newWorker = cluster.fork();
} else {
if (SVRJSInitialized)
if (SVRJSInitialized) {
if (
process.isBun &&
process.versions.bun &&
process.versions.bun[0] != "0"
)
serverconsole.locwarnmessage(
`${name} 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.`
);
else if (process.versions && process.versions.deno)
serverconsole.locwarnmessage(
`${name} limited the number of workers to one, because of startup problems in Deno with shimmed (not native) clustering module. Reliability may suffer.`
);
}
}
} catch (err) {
if (