mirror of
https://github.com/1Panel-dev/1Panel.git
synced 2026-11-21 08:01:13 +00:00
fix(cronjob): schedule an imported pending job when it is edited (#14464)
* fix(cronjob): schedule an imported pending job when it is edited Update decided whether to schedule the job from its old status, so a job imported as Pending was saved as Enable without being added to the scheduler. * Delete agent/app/service/cronjob_test.go --------- Co-authored-by: Ruan Chaves <14352388+ruanchaves@users.noreply.github.com> Co-authored-by: ssongliu <sloooop1x@gmail.com>
This commit is contained in:
co-authored by
Ruan Chaves
ssongliu
parent
faeb39f5c6
commit
aaba86d0ef
@@ -784,7 +784,7 @@ func (u *CronjobService) Update(id uint, req dto.CronjobOperate, operator string
|
||||
return err
|
||||
}
|
||||
spec := cronjob.Spec
|
||||
if cronModel.Status == constant.StatusEnable {
|
||||
if cronModel.Status == constant.StatusEnable || cronModel.Status == constant.StatusPending {
|
||||
newEntryIDs, err := u.StartJob(&cronjob, true)
|
||||
if err != nil {
|
||||
return err
|
||||
|
||||
Reference in New Issue
Block a user