concurrency

This commit is contained in:
unknown 2023-03-28 19:22:47 +02:00
parent 3e9a802dcd
commit 6b583d61c3
1 changed files with 1 additions and 2 deletions

View File

@ -15,7 +15,6 @@ const { PrismaClient } = require('@prisma/client')
const prisma = new PrismaClient() const prisma = new PrismaClient()
const queue = new BQueue('download', { const queue = new BQueue('download', {
concurrency: 4,
redis: { redis: {
host: process.env.REDIS_HOST, host: process.env.REDIS_HOST,
port: process.env.REDIS_PORT, port: process.env.REDIS_PORT,
@ -75,7 +74,7 @@ async function checkChannel(channelId) {
}) })
} }
queue.process(async function (job, done) { queue.process(5, async function (job, done) {
const { video, id } = job.data const { video, id } = job.data
logger.info({ message: `Starting to download ${video.title}, ${id}` }) logger.info({ message: `Starting to download ${video.title}, ${id}` })