Merge pull request #7209 from pixelfed/shleeable-patch-1

Change storage size calculation from floor to ceil
pull/7210/head
Shlee 2 weeks ago committed by GitHub
commit ad52a67f62
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