mirror of
https://github.com/1Panel-dev/1Panel.git
synced 2025-10-07 22:16:16 +08:00
fix: 解决计划任务清除所有数据失败的问题 (#597)
This commit is contained in:
parent
c63897ded4
commit
b2e38c320d
1 changed files with 5 additions and 5 deletions
|
@ -81,11 +81,11 @@ func (u *CronjobService) SearchRecords(search dto.SearchRecord) (int64, interfac
|
||||||
}
|
}
|
||||||
|
|
||||||
func (u *CronjobService) CleanRecord(req dto.CronjobClean) error {
|
func (u *CronjobService) CleanRecord(req dto.CronjobClean) error {
|
||||||
if req.CleanData {
|
cronjob, err := cronjobRepo.Get(commonRepo.WithByID(req.CronjobID))
|
||||||
cronjob, err := cronjobRepo.Get(commonRepo.WithByID(req.CronjobID))
|
if err != nil {
|
||||||
if err != nil {
|
return err
|
||||||
return err
|
}
|
||||||
}
|
if req.CleanData && cronjob.Type != "shell" && cronjob.Type != "curl" {
|
||||||
cronjob.RetainCopies = 0
|
cronjob.RetainCopies = 0
|
||||||
backup, err := backupRepo.Get(commonRepo.WithByID(uint(cronjob.TargetDirID)))
|
backup, err := backupRepo.Get(commonRepo.WithByID(uint(cronjob.TargetDirID)))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
Loading…
Add table
Reference in a new issue