Skip to content

Commit

Permalink
changed to time.NewTicker
Browse files Browse the repository at this point in the history
  • Loading branch information
kubesure committed May 20, 2022
1 parent e62baa5 commit cb61dcb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions dispatch.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ func dispatch(ctx context.Context, i input, w Worker, pulseInterval time.Duratio

go func() {
defer close(pulseStream)
pulse := time.Tick(pulseInterval)
pulse := time.NewTicker(pulseInterval)

sendPulse := func() {
select {
Expand All @@ -35,7 +35,7 @@ func dispatch(ctx context.Context, i input, w Worker, pulseInterval time.Duratio
select {
case <-quitPulstStream:
return
case <-pulse:
case <-pulse.C:
sendPulse()
}
}
Expand Down

0 comments on commit cb61dcb

Please sign in to comment.