]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blame_incremental - server/helpers/upload.ts
Add version to generate types packages
[github/Chocobozzz/PeerTube.git] / server / helpers / upload.ts
... / ...
CommitLineData
1import { join } from 'path'
2import { JobQueue } from '@server/lib/job-queue'
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
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
16// ---------------------------------------------------------------------------
17
18export {
19 getResumableUploadPath,
20 scheduleDeleteResumableUploadMetaFile
21}