]>
Commit | Line | Data |
---|---|---|
f6d6e7f8 | 1 | import { join } from 'path' |
276250f0 | 2 | import { JobQueue } from '@server/lib/job-queue' |
f6d6e7f8 | 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 | ||
276250f0 RK |
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 | ||
f6d6e7f8 | 16 | // --------------------------------------------------------------------------- |
17 | ||
18 | export { | |
276250f0 RK |
19 | getResumableUploadPath, |
20 | scheduleDeleteResumableUploadMetaFile | |
f6d6e7f8 | 21 | } |