We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 37c1f6c commit d5d658cCopy full SHA for d5d658c
watcher/src/workers/supervisor.ts
@@ -29,10 +29,10 @@ function spawnWorker(data: WorkerData) {
29
30
worker.on('exit', (code) => {
31
logger.warn(`Worker ${workerName} exited with code ${code}`);
32
- if (code !== 0) {
33
- logger.error(`Restarting worker ${workerName}...`);
34
- spawnWorker(data);
35
- }
+ // Exit code 0 means the worker exited normally and we should not restart it.
+ // However, if the supervisor forcibly terminates the worker, the exit code may not be 0
+ // and we should not restart it because the supervisor will handle it.
+ // In either case, we should not restart the worker here. Just let the supervisor handle it.
36
});
37
38
workers[workerName] = { worker, data, lastHB: Date.now() };
0 commit comments