Skip to content

Commit

Permalink
fix(pkg.tasker): deprecate sleep dur if next tick timeout
Browse files Browse the repository at this point in the history
  • Loading branch information
adhocore committed May 2, 2021
1 parent 45a4dbe commit 3de45a1
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pkg/tasker/tasker.go
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,9 @@ func (t *Tasker) tickTimer(first bool) (time.Time, bool) {
if t.verbose && !willTime {
t.Log.Printf("[tasker] next tick on %s", next.Format("2006/01/02 15:04:05"))
}
if willTime {
dur = time.Duration(tickSec) - now.Sub(t.until)
}

time.Sleep(dur)
t.timeout = timed && next.After(t.until)
Expand Down

0 comments on commit 3de45a1

Please sign in to comment.