aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/helpers/upload.ts
diff options
context:
space:
mode:
Diffstat (limited to 'server/helpers/upload.ts')
-rw-r--r--server/helpers/upload.ts9
1 files changed, 8 insertions, 1 deletions
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 @@
1import { join } from 'path' 1import { join } from 'path'
2import { JobQueue } from '@server/lib/job-queue'
2import { RESUMABLE_UPLOAD_DIRECTORY } from '../initializers/constants' 3import { RESUMABLE_UPLOAD_DIRECTORY } from '../initializers/constants'
3 4
4function getResumableUploadPath (filename?: string) { 5function getResumableUploadPath (filename?: string) {
@@ -7,8 +8,14 @@ function getResumableUploadPath (filename?: string) {
7 return RESUMABLE_UPLOAD_DIRECTORY 8 return RESUMABLE_UPLOAD_DIRECTORY
8} 9}
9 10
11function 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
10// --------------------------------------------------------------------------- 16// ---------------------------------------------------------------------------
11 17
12export { 18export {
13 getResumableUploadPath 19 getResumableUploadPath,
20 scheduleDeleteResumableUploadMetaFile
14} 21}