updating so it removes from redis after massive file uploaded
This commit is contained in:
parent
7ba142580a
commit
8aebe67620
|
@ -148,8 +148,6 @@ exports.playlist = async (ws, req) => {
|
||||||
await redis.del(id)
|
await redis.del(id)
|
||||||
continue
|
continue
|
||||||
} else {
|
} else {
|
||||||
await redis.del(id)
|
|
||||||
|
|
||||||
const file = fs.readdirSync("./videos").find(f => f.includes(id))
|
const file = fs.readdirSync("./videos").find(f => f.includes(id))
|
||||||
if (file) {
|
if (file) {
|
||||||
fs.renameSync(`./videos/${file}`, `./videos/${id}.webm`)
|
fs.renameSync(`./videos/${file}`, `./videos/${id}.webm`)
|
||||||
|
@ -164,8 +162,9 @@ exports.playlist = async (ws, req) => {
|
||||||
ws.send(`DATA - Created video page for ${video.title}`)
|
ws.send(`DATA - Created video page for ${video.title}`)
|
||||||
} else {
|
} else {
|
||||||
ws.send(`DATA - Failed to find file for ${video.title}. Going to next video in the playlist`)
|
ws.send(`DATA - Failed to find file for ${video.title}. Going to next video in the playlist`)
|
||||||
continue
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
await redis.del(id)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -232,8 +231,6 @@ exports.channel = async (ws, req) => {
|
||||||
await redis.del(id)
|
await redis.del(id)
|
||||||
continue
|
continue
|
||||||
} else {
|
} else {
|
||||||
await redis.del(id)
|
|
||||||
|
|
||||||
const file = fs.readdirSync("./videos").find(f => f.includes(id))
|
const file = fs.readdirSync("./videos").find(f => f.includes(id))
|
||||||
if (file) {
|
if (file) {
|
||||||
fs.renameSync(`./videos/${file}`, `./videos/${id}.webm`)
|
fs.renameSync(`./videos/${file}`, `./videos/${id}.webm`)
|
||||||
|
@ -248,8 +245,9 @@ exports.channel = async (ws, req) => {
|
||||||
ws.send(`DATA - Created video page for ${video.title}`)
|
ws.send(`DATA - Created video page for ${video.title}`)
|
||||||
} else {
|
} else {
|
||||||
ws.send(`DATA - Failed to find file for ${video.title}. Going to next video`)
|
ws.send(`DATA - Failed to find file for ${video.title}. Going to next video`)
|
||||||
continue
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
await redis.del(id)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -42,8 +42,6 @@ async function handleDownload(channelId) {
|
||||||
await redis.del(id)
|
await redis.del(id)
|
||||||
continue
|
continue
|
||||||
} else {
|
} else {
|
||||||
await redis.del(id)
|
|
||||||
|
|
||||||
const file = fs.readdirSync("./videos").find(f => f.includes(id))
|
const file = fs.readdirSync("./videos").find(f => f.includes(id))
|
||||||
if (file) {
|
if (file) {
|
||||||
fs.renameSync(`./videos/${file}`, `./videos/${id}.webm`)
|
fs.renameSync(`./videos/${file}`, `./videos/${id}.webm`)
|
||||||
|
@ -56,8 +54,9 @@ async function handleDownload(channelId) {
|
||||||
await websocket.createDatabaseVideo(id, videoUrl)
|
await websocket.createDatabaseVideo(id, videoUrl)
|
||||||
} else {
|
} else {
|
||||||
logger.info({ message: `Couldn't find file for ${video.title}, ${id}` })
|
logger.info({ message: `Couldn't find file for ${video.title}, ${id}` })
|
||||||
continue
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
await redis.del(id)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue