remove restart on error
This commit is contained in:
parent
e0a8d2350e
commit
5ddaacea5c
2 changed files with 3 additions and 3 deletions
|
@ -207,7 +207,6 @@ class StreamBuffer extends EventEmitter {
|
|||
}
|
||||
this.streams.output.on('error', (error) => {
|
||||
logger.error('output stream encountered an error: ' + error);
|
||||
restart();
|
||||
});
|
||||
this.streams.output.on('written', (bytes) => {
|
||||
this.#writeBufferedChunk(bytes);
|
||||
|
|
|
@ -26,16 +26,17 @@ async function sleep(ms) {
|
|||
}
|
||||
|
||||
function restart() {
|
||||
logger.info('restarting...');
|
||||
const args = process.argv;
|
||||
const cmd = args[0];
|
||||
args.shift();
|
||||
const newProcess = spawn(cmd, args, { detached: true, stdio: 'ignore' });
|
||||
newProcess.unref();
|
||||
newProcess.on('error', (error) => {
|
||||
logger.error('ERROR RESTARTING: '+ error);
|
||||
logger.error('encountered an error restarting: ' + error);
|
||||
});
|
||||
newProcess.on('spawn', () => {
|
||||
logger.warn('PROCESS RESTARTED WITH PID: ' + newProcess.pid);
|
||||
logger.warn('spawned process with pid \'' + newProcess.pid + '\'');
|
||||
process.exit(0);
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue