Skip to content

Commit

Permalink
fix(scheduler): don't error if start_date is before now for cron
Browse files Browse the repository at this point in the history
  • Loading branch information
karol-kokoszka committed Feb 20, 2024
1 parent 22d2146 commit 3d43f5e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/service/scheduler/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ func (s *Service) PutTask(ctx context.Context, t *Task) error {
if t.Sched.Cron.IsZero() {
run = true
}
} else if t.Sched.StartDate.Before(now()) {
} else if t.Sched.StartDate.Before(now()) && t.Sched.Interval != 0 {
return errors.New("start date of scheduled task cannot be in the past")
}

Expand Down

0 comments on commit 3d43f5e

Please sign in to comment.