From 1ade1b8d8b56aa29308fa25c4cf89ff4e00cf44e Mon Sep 17 00:00:00 2001 From: ssongliu <73214554+ssongliu@users.noreply.github.com> Date: Tue, 19 Aug 2025 14:58:18 +0800 Subject: [PATCH] fix: Fix temporary file leak during snapshot deletion (#10052) --- agent/app/service/snapshot.go | 1 + 1 file changed, 1 insertion(+) diff --git a/agent/app/service/snapshot.go b/agent/app/service/snapshot.go index 200aa5051..0a16abe68 100644 --- a/agent/app/service/snapshot.go +++ b/agent/app/service/snapshot.go @@ -156,6 +156,7 @@ func (u *SnapshotService) Delete(req dto.SnapshotBatchDelete) error { } _ = backupRepo.DeleteRecord(context.Background(), repo.WithByType("snapshot"), backupRepo.WithByFileName(snap.Name+".tar.gz")) } + _ = os.Remove(path.Join(global.Dir.LocalBackupDir, "tmp/system", snap.Name+".tar.gz")) if err := snapshotRepo.Delete(repo.WithByID(snap.ID)); err != nil { return err