quota: improve size check

get the remaining allowed size when an upload starts and check it against the
uploaded bytes

Fixes #128
This commit is contained in:
Nicola Murino
2020-06-18 22:38:03 +02:00
parent 3ceba7a147
commit e86089a9f3
11 changed files with 298 additions and 48 deletions

View File

@@ -170,7 +170,9 @@ func newActionNotification(user dataprovider.User, operation, filePath, target,
} else if user.FsConfig.Provider == 2 {
bucket = user.FsConfig.GCSConfig.Bucket
}
if err != nil {
if err == errQuotaExceeded {
status = 2
} else if err != nil {
status = 0
}
return actionNotification{