mirror of
https://github.com/1Panel-dev/1Panel.git
synced 2025-12-26 09:22:50 +08:00
fix: Fix temporary file leak during snapshot deletion (#10052)
This commit is contained in:
parent
19fa30fb96
commit
1ade1b8d8b
1 changed files with 1 additions and 0 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue