Skip to content

Commit

Permalink
chore: return explicit error on empty schedule
Browse files Browse the repository at this point in the history
  • Loading branch information
yashmehrotra committed Jan 31, 2024
1 parent e229c64 commit b47f7ec
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions job/job.go
Original file line number Diff line number Diff line change
Expand Up @@ -394,6 +394,11 @@ func (j *Job) AddToScheduler(cronRunner *cron.Cron) error {
if override, ok := getProperty(j, j.Context.Properties(), "schedule"); ok {
schedule = override
}

if schedule == "" {
return fmt.Errorf("job schedule cannot be empty")
}

if schedule == "@never" {
j.Context.Infof("skipping scheduling")
return nil
Expand Down

0 comments on commit b47f7ec

Please sign in to comment.