Skip to content

Commit

Permalink
Merge pull request #9 from madflojo/toofast
Browse files Browse the repository at this point in the history
Adding delay only for late starters
  • Loading branch information
madflojo authored May 27, 2022
2 parents 39498df + 52f3714 commit 13e623f
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions tasks.go
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,10 @@ func (schd *Scheduler) AddWithID(id string, t *Task) error {
t.id = id
schd.tasks[t.id] = t

if t.StartAfter.IsZero() {
schd.scheduleTask(t)
return nil
}
go schd.scheduleTask(t)
return nil
}
Expand Down

0 comments on commit 13e623f

Please sign in to comment.