Skip to content

Commit

Permalink
time.Until vs. time.Sub
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnRoesler committed May 3, 2023
1 parent 45d90b7 commit 1e27df1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion executor.go
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ func (e *executor) run() {
return
}
defer func() {
durationToNextRun := f.jobFuncNextRun.Sub(time.Now())
durationToNextRun := time.Until(f.jobFuncNextRun)
if durationToNextRun > time.Second*5 {
durationToNextRun = time.Second * 5
}
Expand Down

0 comments on commit 1e27df1

Please sign in to comment.