X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;ds=sidebyside;f=server%2Fhelpers%2Fupload.ts;h=f5f476913eb8006c4649c101458c4b69b0292db3;hb=ce1b5ba78c35cfd4df123cab49aef1d14ca0f9b7;hp=c94c7ab82d316065b6294030186607dda1ae5e1a;hpb=276250f0a36e00373166d91d539e5220d6f158c7;p=github%2FChocobozzz%2FPeerTube.git diff --git a/server/helpers/upload.ts b/server/helpers/upload.ts index c94c7ab82..f5f476913 100644 --- a/server/helpers/upload.ts +++ b/server/helpers/upload.ts @@ -1,21 +1,14 @@ import { join } from 'path' -import { JobQueue } from '@server/lib/job-queue' -import { RESUMABLE_UPLOAD_DIRECTORY } from '../initializers/constants' +import { DIRECTORIES } from '@server/initializers/constants' function getResumableUploadPath (filename?: string) { - if (filename) return join(RESUMABLE_UPLOAD_DIRECTORY, filename) + if (filename) return join(DIRECTORIES.RESUMABLE_UPLOAD, filename) - 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 + return DIRECTORIES.RESUMABLE_UPLOAD } // --------------------------------------------------------------------------- export { - getResumableUploadPath, - scheduleDeleteResumableUploadMetaFile + getResumableUploadPath }