From 23a1fbdd4be1afe986c9836faeaaca724ce1e037 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=98=AD?= <81747598+lan-yonghui@users.noreply.github.com> Date: Tue, 17 Jun 2025 18:42:54 +0800 Subject: [PATCH] fix: Clear cache by specifying default values (#9154) #8933 --- agent/app/service/device_clean.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/agent/app/service/device_clean.go b/agent/app/service/device_clean.go index ca458b6e2..ec236d293 100644 --- a/agent/app/service/device_clean.go +++ b/agent/app/service/device_clean.go @@ -51,7 +51,7 @@ func (u *DeviceService) Scan() dto.CleanData { ID: uuid.NewString(), Label: "1panel_original", Size: uint64(originalSize), - IsCheck: true, + IsCheck: originalSize > 0, IsRecommend: true, Type: "1panel_original", Children: loadTreeWithDir(true, "1panel_original", originalPath, fileOp), @@ -86,7 +86,7 @@ func (u *DeviceService) Scan() dto.CleanData { ID: uuid.NewString(), Label: "snapshot", Size: snapSize, - IsCheck: true, + IsCheck: snapSize > 0, IsRecommend: true, Type: "snapshot", Children: snapTree, @@ -101,7 +101,7 @@ func (u *DeviceService) Scan() dto.CleanData { ID: uuid.NewString(), Label: "rollback", Size: rollbackSize, - IsCheck: true, + IsCheck: rollbackSize > 0, IsRecommend: true, Type: "rollback", Children: rollBackTree, @@ -127,7 +127,7 @@ func (u *DeviceService) Scan() dto.CleanData { ID: uuid.NewString(), Label: "unused", Size: unusedSize, - IsCheck: true, + IsCheck: unusedSize > 0, IsRecommend: true, Type: "unused", Children: unusedTree,