diff --git a/core/job/service/job_service.go b/core/job/service/job_service.go index 1b1d13680c..e4afee0e35 100644 --- a/core/job/service/job_service.go +++ b/core/job/service/job_service.go @@ -357,15 +357,10 @@ func (j JobService) Validate(ctx context.Context, jobTenant tenant.Tenant, jobSp } // check cyclic deps for every job - isAlreadyCyclic := map[string]bool{} for _, jobEntity := range jobsWithUnresolvedUpstreams { - if jobNamesWithCyclic, err := j.validateCyclic(jobEntity.Job().Spec().Name(), jobMap, identifierToJobsMap); err != nil { - if _, ok := isAlreadyCyclic[jobEntity.Job().Spec().Name().String()]; !ok { - me.Append(err) - } - for _, jobName := range jobNamesWithCyclic { - isAlreadyCyclic[jobName] = true - } + if _, err := j.validateCyclic(jobEntity.Job().Spec().Name(), jobMap, identifierToJobsMap); err != nil { + me.Append(err) + break } }