mirror of https://github.com/preservetube/auto.git
concurrency
This commit is contained in:
parent
3e9a802dcd
commit
6b583d61c3
3
index.js
3
index.js
|
@ -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}` })
|
||||||
|
|
Loading…
Reference in New Issue