From 5ddaacea5c137758af4f336d5e2edc0ca2493213 Mon Sep 17 00:00:00 2001 From: velvettear Date: Tue, 3 May 2022 15:21:42 +0200 Subject: [PATCH] remove restart on error --- classes/AudioBuffer.js | 1 - libs/util.js | 5 +++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/classes/AudioBuffer.js b/classes/AudioBuffer.js index 3fd5757..74b6aaa 100644 --- a/classes/AudioBuffer.js +++ b/classes/AudioBuffer.js @@ -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); diff --git a/libs/util.js b/libs/util.js index c59e879..9e03f1d 100644 --- a/libs/util.js +++ b/libs/util.js @@ -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); }); }