]>
Commit | Line | Data |
---|---|---|
1 | import { join } from 'path' | |
2 | import { JobQueue } from '@server/lib/job-queue' | |
3 | import { RESUMABLE_UPLOAD_DIRECTORY } from '../initializers/constants' | |
4 | ||
5 | function getResumableUploadPath (filename?: string) { | |
6 | if (filename) return join(RESUMABLE_UPLOAD_DIRECTORY, filename) | |
7 | ||
8 | return RESUMABLE_UPLOAD_DIRECTORY | |
9 | } | |
10 | ||
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 | |
14 | } | |
15 | ||
16 | // --------------------------------------------------------------------------- | |
17 | ||
18 | export { | |
19 | getResumableUploadPath, | |
20 | scheduleDeleteResumableUploadMetaFile | |
21 | } |