mirror of
https://github.com/Chocobozzz/PeerTube.git
synced 2025-10-05 19:42:24 +02:00
prevent multiple post-process triggering of upload-resumable (#4175)
* prevent multiple post-process triggering of upload-resumable * switch from 409 to 503 for upload being processed * Improve resumable upload check Co-authored-by: Chocobozzz <me@florianbigard.com>
This commit is contained in:
parent
b2ad0090c1
commit
276250f0a3
10 changed files with 107 additions and 13 deletions
|
@ -1,4 +1,5 @@
|
|||
import { join } from 'path'
|
||||
import { JobQueue } from '@server/lib/job-queue'
|
||||
import { RESUMABLE_UPLOAD_DIRECTORY } from '../initializers/constants'
|
||||
|
||||
function getResumableUploadPath (filename?: string) {
|
||||
|
@ -7,8 +8,14 @@ function getResumableUploadPath (filename?: string) {
|
|||
return RESUMABLE_UPLOAD_DIRECTORY
|
||||
}
|
||||
|
||||
function scheduleDeleteResumableUploadMetaFile (filepath: string) {
|
||||
const payload = { filepath }
|
||||
JobQueue.Instance.createJob({ type: 'delete-resumable-upload-meta-file', payload }, { delay: 900 * 1000 }) // executed in 15 min
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
export {
|
||||
getResumableUploadPath
|
||||
getResumableUploadPath,
|
||||
scheduleDeleteResumableUploadMetaFile
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue