From 12a203ab9af8b16962e794b69bfe752024dc8c6c Mon Sep 17 00:00:00 2001 From: xenudu Date: Sun, 15 Aug 2021 18:50:45 -0600 Subject: [PATCH] update main.js to only launch main worker process once --- lib/main.js | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/lib/main.js b/lib/main.js index 07c46d5..9d26b44 100755 --- a/lib/main.js +++ b/lib/main.js @@ -212,9 +212,15 @@ let startPreparationTask = () => { * Question status * @type {Boolean} */ - let didShowQuestion = false + let didShowQuestion = false /** + * Primary Task Started + * @type {Boolean} + */ + let didStartPrimaryTask = false + + /** * Handles prepTask.stdout * @param {Buffer|String} data - FFmpeg Live Log Output Buffer */ @@ -230,7 +236,10 @@ let startPreparationTask = () => { } // Send SIGKILL: preparation task succeeded prepTask.kill('SIGKILL') - startPrimaryTask(outputDuration, outputFilename) + if(!didStartPrimaryTask) { + startPrimaryTask(outputDuration, outputFilename) + didStartPrimaryTask = true + } } }