fix: storage setting changed don't take effect (#2385)

* fix: Storage setting changed don't take effect

* fix: Storage setting changed don't take effect

* fix: Storage setting changed don't take effect
This commit is contained in:
guopeng
2023-10-16 21:07:21 +08:00
committed by GitHub
parent c999d71455
commit 73f59eaf09
6 changed files with 67 additions and 7 deletions

View File

@@ -2,7 +2,6 @@ package v2
import (
"context"
"os"
"strconv"
"google.golang.org/grpc/codes"
@@ -37,11 +36,11 @@ func (s *SystemService) GetSystemInfo(ctx context.Context, _ *apiv2pb.GetSystemI
return nil, status.Errorf(codes.Internal, "failed to get current user: %v", err)
}
if currentUser != nil && currentUser.Role == store.RoleHost {
fi, err := os.Stat(s.Profile.DSN)
size, err := s.Store.GetCurrentDBSize(ctx)
if err != nil {
return nil, status.Errorf(codes.Internal, "failed to get file info: %v", err)
return nil, status.Errorf(codes.Internal, "failed to get db size: %v", err)
}
defaultSystemInfo.DbSize = fi.Size()
defaultSystemInfo.DbSize = size
}
response := &apiv2pb.GetSystemInfoResponse{