]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blame - server/helpers/upload.ts
fix plugin storage return value when storing a Json array
[github/Chocobozzz/PeerTube.git] / server / helpers / upload.ts
CommitLineData
f6d6e7f8 1import { join } from 'path'
276250f0 2import { JobQueue } from '@server/lib/job-queue'
f6d6e7f8 3import { RESUMABLE_UPLOAD_DIRECTORY } from '../initializers/constants'
4
5function getResumableUploadPath (filename?: string) {
6 if (filename) return join(RESUMABLE_UPLOAD_DIRECTORY, filename)
7
8 return RESUMABLE_UPLOAD_DIRECTORY
9}
10
276250f0
RK
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
f6d6e7f8 16// ---------------------------------------------------------------------------
17
18export {
276250f0
RK
19 getResumableUploadPath,
20 scheduleDeleteResumableUploadMetaFile
f6d6e7f8 21}