fix(user_store): add a work around for calculating used space
This commit is contained in:
parent
73a6dfe4ae
commit
e43ea8507c
2 changed files with 13 additions and 2 deletions
|
@ -381,6 +381,9 @@ func (us *KVUserStore) SetUsed(id uint64, incr bool, capacity int64) error {
|
|||
gotUser.UsedSpace = gotUser.UsedSpace + capacity
|
||||
} else {
|
||||
gotUser.UsedSpace = gotUser.UsedSpace - capacity
|
||||
if gotUser.UsedSpace < 0 { // TODO: this is a work around
|
||||
gotUser.UsedSpace = 0
|
||||
}
|
||||
}
|
||||
infoBytes, err := json.Marshal(gotUser)
|
||||
if err != nil {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue