Change storage size calculation from floor to ceil

pull/7209/head
Shlee 2 weeks ago committed by GitHub
parent 69f9c6c64e
commit ad686571bf
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -107,7 +107,7 @@ class UserStorageService
return self::recalculateUpdateStorageUsed($id);
}
$sizeInKbs = (int) floor(((int) $sizeInBytes) / 1000);
$sizeInKbs = (int) ceil(((int) $sizeInBytes) / 1000);
$updatedVal = max(0, (int) $user->storage_used + $sizeInKbs);
$user->storage_used = $updatedVal;
@ -147,7 +147,7 @@ class UserStorageService
return self::recalculateUpdateStorageUsed($id);
}
$sizeInKbs = (int) floor(((int) $sizeInBytes) / 1000);
$sizeInKbs = (int) ceil(((int) $sizeInBytes) / 1000);
$updatedVal = max(0, (int) $user->storage_used - $sizeInKbs);
$user->storage_used = $updatedVal;

Loading…
Cancel
Save