mirror of
https://github.com/tcgdex/cards-database.git
synced 2025-04-22 02:42:09 +00:00
fix: random exit from worker making server not react (#685)
This commit is contained in:
parent
16caf3384e
commit
c3cfb2607a
@ -27,15 +27,16 @@ if (cluster.isPrimary) {
|
||||
// create the workers
|
||||
console.log(`creating ${maxWorkers} workers...`)
|
||||
for (let i = 0; i < maxWorkers; i++) {
|
||||
cluster.fork();
|
||||
cluster.fork()
|
||||
}
|
||||
|
||||
cluster.on('online', (worker) => {
|
||||
console.log('Worker', worker.id, 'online')
|
||||
})
|
||||
|
||||
cluster.on("exit", (worker, code, _signal) => {
|
||||
console.log(`Worker ${worker.id} exited with code ${code}`);
|
||||
cluster.on("exit", (worker, code, signal) => {
|
||||
console.log(`Worker ${worker.id} exited with code ${code} and signal ${signal}`);
|
||||
cluster.fork()
|
||||
})
|
||||
console.log('🚀 Server ready at localhost:3000');
|
||||
} else {
|
||||
|
Loading…
x
Reference in New Issue
Block a user