From aaba86d0ef71a31ee319e74998ffe83c64abf4b6 Mon Sep 17 00:00:00 2001 From: Ruan Chaves Date: Wed, 18 Nov 2026 05:09:39 -0300 Subject: [PATCH] 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 --- agent/app/service/cronjob.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/agent/app/service/cronjob.go b/agent/app/service/cronjob.go index 32cb14137..d0375efac 100644 --- a/agent/app/service/cronjob.go +++ b/agent/app/service/cronjob.go @@ -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