From d60e400f83085602f971ab6478bd1dcee87ab6ad Mon Sep 17 00:00:00 2001 From: Aaron Liu Date: Sun, 20 Apr 2025 18:55:01 +0800 Subject: [PATCH] fix(dashboard): incorrectly calculate user total storage --- inventory/user.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/inventory/user.go b/inventory/user.go index 1fe16ee..26470ed 100644 --- a/inventory/user.go +++ b/inventory/user.go @@ -230,12 +230,13 @@ func (c *userClient) ApplyStorageDiff(ctx context.Context, diffs StorageDiff) er func (c *userClient) CalculateStorage(ctx context.Context, uid int) (int64, error) { var sum int64 - batchSize := 5000 + batchSize := 30000 offset := 0 for { allFiles, err := c.client.File.Query(). Where(file.HasOwnerWith(user.ID(uid))). + Where(file.Type(int(types.FileTypeFile))). WithEntities(). Offset(offset). Limit(batchSize).