X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=server%2Fhelpers%2Fupload.ts;h=c94c7ab82d316065b6294030186607dda1ae5e1a;hb=276250f0a36e00373166d91d539e5220d6f158c7;hp=3cb17edd0aeaafeea1eb5dc369e787326fb2d92f;hpb=b2ad0090c182c7f2a8cba1cced3987d408a4b159;p=github%2FChocobozzz%2FPeerTube.git diff --git a/server/helpers/upload.ts b/server/helpers/upload.ts index 3cb17edd0..c94c7ab82 100644 --- a/server/helpers/upload.ts +++ b/server/helpers/upload.ts @@ -1,4 +1,5 @@ import { join } from 'path' +import { JobQueue } from '@server/lib/job-queue' import { RESUMABLE_UPLOAD_DIRECTORY } from '../initializers/constants' function getResumableUploadPath (filename?: string) { @@ -7,8 +8,14 @@ function getResumableUploadPath (filename?: string) { return RESUMABLE_UPLOAD_DIRECTORY } +function scheduleDeleteResumableUploadMetaFile (filepath: string) { + const payload = { filepath } + JobQueue.Instance.createJob({ type: 'delete-resumable-upload-meta-file', payload }, { delay: 900 * 1000 }) // executed in 15 min +} + // --------------------------------------------------------------------------- export { - getResumableUploadPath + getResumableUploadPath, + scheduleDeleteResumableUploadMetaFile }