1
0
Fork 0
mirror of https://github.com/Chocobozzz/PeerTube.git synced 2025-10-03 09:49:20 +02:00

Stop caching upload after successful upload

Just forbid sending 2 concurrent requests, but let the user decide if
it wants to upload the same video multiple times
This commit is contained in:
Chocobozzz 2024-02-19 14:41:38 +01:00
parent ebe828ec75
commit 7b86b9b458
No known key found for this signature in database
GPG key ID: 583A612D890159BE
4 changed files with 9 additions and 85 deletions

View file

@ -307,28 +307,14 @@ class Redis {
/* ************ Resumable uploads final responses ************ */
setUploadSession (uploadId: string, response?: { video: { id: number, shortUUID: string, uuid: string } }) {
return this.setValue(
'resumable-upload-' + uploadId,
response
? JSON.stringify(response)
: '',
RESUMABLE_UPLOAD_SESSION_LIFETIME
)
setUploadSession (uploadId: string) {
return this.setValue('resumable-upload-' + uploadId, '', RESUMABLE_UPLOAD_SESSION_LIFETIME)
}
doesUploadSessionExist (uploadId: string) {
return this.exists('resumable-upload-' + uploadId)
}
async getUploadSession (uploadId: string) {
const value = await this.getValue('resumable-upload-' + uploadId)
return value
? JSON.parse(value) as { video: { id: number, shortUUID: string, uuid: string } }
: undefined
}
deleteUploadSession (uploadId: string) {
return this.deleteKey('resumable-upload-' + uploadId)
}