1 import { join } from 'path'
2 import { JobQueue } from '@server/lib/job-queue'
3 import { RESUMABLE_UPLOAD_DIRECTORY } from '../initializers/constants'
5 function getResumableUploadPath (filename?: string) {
6 if (filename) return join(RESUMABLE_UPLOAD_DIRECTORY, filename)
8 return RESUMABLE_UPLOAD_DIRECTORY
11 function scheduleDeleteResumableUploadMetaFile (filepath: string) {
12 const payload = { filepath }
13 JobQueue.Instance.createJob({ type: 'delete-resumable-upload-meta-file', payload }, { delay: 900 * 1000 }) // executed in 15 min
16 // ---------------------------------------------------------------------------
19 getResumableUploadPath,
20 scheduleDeleteResumableUploadMetaFile