Refactoring and small optimizations

This commit is contained in:
2022-01-30 12:18:36 +01:00
parent 9dcfade3fd
commit 33d567aaed
10 changed files with 91 additions and 34 deletions

View File

@@ -9,6 +9,7 @@ import { ytdlpUpdater } from './utils/updater';
import { download, abortDownload, retriveDownload, abortAllDownloads } from './core/downloader';
import Logger from './utils/BetterLogger';
import { retrieveAll, init } from './db/db';
import { getFreeDiskSpace } from './utils/procUtils';
const app = new Koa()
const log = new Logger()
@@ -45,6 +46,9 @@ io.on('connection', socket => {
socket.on('retrieve-jobs', () => {
retriveDownload(socket)
})
socket.on('disk-space', () => {
getFreeDiskSpace(socket)
})
})
io.on('disconnect', (socket) => {