mirror of
https://github.com/1Panel-dev/1Panel.git
synced 2026-09-22 16:00:51 +00:00
fix: Fix temporary file leak during snapshot deletion (#10052)
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user