Revert "avoid vm running out of disk space again"

This reverts commit d7efc8f848.
This commit is contained in:
localhost 2024-01-01 18:04:49 +01:00
parent d7efc8f848
commit d07d2a3a36
1 changed files with 8 additions and 17 deletions

View File

@ -80,7 +80,6 @@ exports.save = async (ws, req) => {
} else { } else {
const file = fs.readdirSync("videos").find(f => f.includes(id)) const file = fs.readdirSync("videos").find(f => f.includes(id))
if (file) { if (file) {
try {
fs.renameSync(`./videos/${file}`, `./videos/${id}.webm`) fs.renameSync(`./videos/${file}`, `./videos/${id}.webm`)
ws.send('DATA - Uploading file...') ws.send('DATA - Uploading file...')
@ -88,14 +87,8 @@ exports.save = async (ws, req) => {
fs.unlinkSync(`./videos/${id}.webm`) fs.unlinkSync(`./videos/${id}.webm`)
await websocket.createDatabaseVideo(id, videoUrl) await websocket.createDatabaseVideo(id, videoUrl)
ws.send(`DONE - ${process.env.FRONTEND}/watch?v=${id}`) ws.send(`DONE - ${process.env.FRONTEND}/watch?v=${id}`)
} catch (e) {
ws.send('DATA - Server side error while processing video. Please try again.')
fs.unlinkSync(`./videos/${id}.webm`)
logger.error(e)
}
} else {
ws.send('DATA - Failed to find file video.')
} }
await redis.del(id) await redis.del(id)
@ -196,7 +189,6 @@ exports.playlist = async (ws, req) => {
ws.send(`DATA - Created video page for ${video.title}`) ws.send(`DATA - Created video page for ${video.title}`)
} catch (e) { } catch (e) {
ws.send(`DATA - Failed downloading video ${video.title}. Going to next video`) ws.send(`DATA - Failed downloading video ${video.title}. Going to next video`)
fs.unlinkSync(`./videos/${id}.webm`)
logger.error(e) logger.error(e)
} }
} else { } else {
@ -295,7 +287,6 @@ exports.channel = async (ws, req) => {
ws.send(`DATA - Created video page for ${video.title}`) ws.send(`DATA - Created video page for ${video.title}`)
} catch (e) { } catch (e) {
ws.send(`DATA - Failed downloading video ${video.title}. Going to next video`) ws.send(`DATA - Failed downloading video ${video.title}. Going to next video`)
fs.unlinkSync(`./videos/${id}.webm`)
logger.error(e) logger.error(e)
} }
} else { } else {