Skip to content

Commit

Permalink
Merge pull request #2409 from opengovern/fix-queries
Browse files Browse the repository at this point in the history
fix: skip compliance job with failed validator
  • Loading branch information
artaasadi authored Jan 10, 2025
2 parents 19f822a + 3099129 commit ec64414
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,9 @@ func (s *JobScheduler) runPublisher(ctx context.Context) error {
}
err = s.ValidateComplianceJob(*framework)
if err != nil {
s.logger.Error("framework validation failed", zap.String("frameworkID", job.FrameworkID), zap.Error(err))
_ = s.db.UpdateComplianceJob(job.ID, model.ComplianceJobFailed, err.Error())
continue
}
}

Expand Down
2 changes: 2 additions & 0 deletions services/scheduler/schedulers/compliance/trigger.go
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,9 @@ func (s *JobScheduler) enqueueRunnersCycle() error {
}
err = s.ValidateComplianceJob(*framework)
if err != nil {
s.logger.Error("framework validation failed", zap.String("frameworkID", job.FrameworkID), zap.Error(err))
_ = s.db.UpdateComplianceJob(job.ID, model.ComplianceJobFailed, err.Error())
continue
}
}
s.logger.Info("processing job with unqueued runners", zap.Uint("jobID", job.ID))
Expand Down

0 comments on commit ec64414

Please sign in to comment.