forked from svrjs/svrjs
fix: fix the cluster limit of one process for Deno with shimmed clustering module
This commit is contained in:
parent
63d3f5df32
commit
38cf8bb68d
1 changed files with 15 additions and 5 deletions
14
src/index.js
14
src/index.js
|
@ -1436,16 +1436,26 @@ function SVRJSFork() {
|
||||||
((process.isBun &&
|
((process.isBun &&
|
||||||
process.versions.bun &&
|
process.versions.bun &&
|
||||||
process.versions.bun[0] != "0") ||
|
process.versions.bun[0] != "0") ||
|
||||||
(process.versions && process.versions.deno_)) &&
|
(process.versions && process.versions.deno)) &&
|
||||||
Object.keys(cluster.workers) > 0
|
Object.keys(cluster.workers) > 0
|
||||||
)
|
)
|
||||||
) {
|
) {
|
||||||
newWorker = cluster.fork();
|
newWorker = cluster.fork();
|
||||||
} else {
|
} else {
|
||||||
if (SVRJSInitialized)
|
if (SVRJSInitialized) {
|
||||||
|
if (
|
||||||
|
process.isBun &&
|
||||||
|
process.versions.bun &&
|
||||||
|
process.versions.bun[0] != "0"
|
||||||
|
)
|
||||||
serverconsole.locwarnmessage(
|
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.`
|
`${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) {
|
} catch (err) {
|
||||||
if (
|
if (
|
||||||
|
|
Reference in a new issue