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 19, 2024
1 parent 518cf28 commit eb1248b
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 eb1248b

Please sign in to comment.