quota tracking: fix concurrent updates

added a test case to check quota size for upload that replace an existing file
This commit is contained in:
Nicola Murino
2019-07-28 13:24:46 +02:00
parent b728a06984
commit c547c5c9ee
6 changed files with 85 additions and 36 deletions

View File

@@ -57,9 +57,11 @@ func (t *Transfer) Close() error {
executeAction(operationUpload, t.user.Username, t.path, "")
}
removeTransfer(t)
if t.transferType == transferUpload && t.bytesReceived > 0 && t.isNewFile {
if t.transferType == transferUpload {
numFiles := 0
numFiles++
if t.isNewFile {
numFiles = 1
}
dataprovider.UpdateUserQuota(dataProvider, t.user.Username, numFiles, t.bytesReceived, false)
}
return err