This commit is contained in:
unknown 2023-03-23 22:40:00 +01:00
parent 474bcc9574
commit 7916399990
1 changed files with 4 additions and 4 deletions

View File

@ -14,9 +14,9 @@ const prisma = new PrismaClient()
async function handleCheck() { async function handleCheck() {
const channels = await prisma.autodownload.findMany() const channels = await prisma.autodownload.findMany()
channels.forEach(async (c) => { for (c of channels) {
await handleDownload(c.channel) await handleDownload(c.channel)
}) }
} }
async function handleDownload(channelId) { async function handleDownload(channelId) {
@ -58,11 +58,11 @@ async function handleDownload(channelId) {
fs.unlinkSync(`./videos/${id}.webm`) fs.unlinkSync(`./videos/${id}.webm`)
await websocket.createDatabaseVideo(id, videoUrl) await websocket.createDatabaseVideo(id, videoUrl)
await redis.del(id)
} else { } else {
await redis.set(id, 'error')
logger.info({ message: `Couldn't find file for ${video.title}, ${id}` }) logger.info({ message: `Couldn't find file for ${video.title}, ${id}` })
} }
await redis.del(id)
} }
} }
} }