mirror of
https://github.com/drakkan/sftpgo.git
synced 2025-12-07 23:00:55 +03:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user