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:
parent
ebe828ec75
commit
7b86b9b458
4 changed files with 9 additions and 85 deletions
|
@ -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)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue