Skip to content

Commit

Permalink
Stop logging poller errors after stop
Browse files Browse the repository at this point in the history
  • Loading branch information
cretz committed Aug 29, 2022
1 parent 85978da commit 60e4e24
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions internal/internal_worker_base.go
Original file line number Diff line number Diff line change
Expand Up @@ -357,6 +357,13 @@ func (bw *baseWorker) pollTask() {
}

func (bw *baseWorker) logPollTaskError(err error) {
// We do not want to log any errors after we were explicitly stopped
select {
case <-bw.stopCh:
return
default:
}

bw.lastPollTaskErrLock.Lock()
defer bw.lastPollTaskErrLock.Unlock()
// No error means reset the message and time
Expand Down

0 comments on commit 60e4e24

Please sign in to comment.