From 804b1cefc23f16b1c2dd5d60b8458ea4d915d4fd Mon Sep 17 00:00:00 2001 From: Lightling Date: Wed, 28 Feb 2024 17:54:27 -0500 Subject: [PATCH] replace inaccurate proc count with remaining procs --- lib/dl.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/dl.js b/lib/dl.js index ef05d74..b475362 100644 --- a/lib/dl.js +++ b/lib/dl.js @@ -49,9 +49,9 @@ export const getMany = (userDb, threadMax, directory, mode) => new Promise((reso const checkError = (currentIndex, type, codeOrError) => { userDb[currentIndex].logs.push(codeOrError.toString()); if (typeof codeOrError === 'number' && userDb[currentIndex].running === mode) { - userDb[currentIndex].running = false; + userDb[currentIndex].running = `finished ${mode}`; --running; - log(ctx, `Finished (via ${type}) ${userDb[currentIndex].user} under ${mode} mode. ${running} processes still running.`); + log(ctx, `Finished (via ${type}) ${userDb[currentIndex].user} under ${mode} mode. ${userDb.filter(elem => elem.running !== `finished ${mode}`).length} users left.`); get(); } };