From f7fcf871ec06c94ecfbc4d4410db12894e00f1a5 Mon Sep 17 00:00:00 2001 From: unknown <89595418+unknownsrc@users.noreply.github.com> Date: Fri, 12 May 2023 20:52:36 +0200 Subject: [PATCH] 1 at a time and done() --- index.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/index.js b/index.js index cbeae64..980fe4f 100644 --- a/index.js +++ b/index.js @@ -89,7 +89,7 @@ async function checkChannel(channelId) { }) } -queue.process(3, async function (job, done) { +queue.process(1, async function (job, done) { const { video, id } = job.data logger.info({ message: `Starting to download ${video.title}, ${id}` }) @@ -111,6 +111,7 @@ queue.process(3, async function (job, done) { await database.createDatabaseVideo(id, videoUrl) await redis.del(id) + return done() } else { await redis.set(`blacklist:${id}`, 'error') logger.info({ message: `Couldn't find file for ${video.title}, ${id}` }) @@ -124,6 +125,8 @@ channelQueue.process(10, async function (job, done) { await checkChannel(c.channel) await redis.del(c.channel) + + done() }) check()