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 authored and moshloop committed Jan 31, 2024
1 parent b1f95bc commit 2d82dd9
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 2d82dd9

Please sign in to comment.