Skip to content

Commit

Permalink
command/controller.go: Send a struct{}{} to StopCh rather than closing
Browse files Browse the repository at this point in the history
  • Loading branch information
dbellinghoven committed Dec 7, 2018
1 parent 4facad3 commit 7b28783
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions command/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,12 +89,12 @@ func (ctrl *controller) startQueryHandlers(ctx context.Context) {

func (ctrl *controller) stopQueryHandlers() {
for _, qh := range ctrl.queryHandlers {
close(qh.StopCh)
qh.StopCh <- struct {}{}
}
ctrl.queryHandlerWG.Wait()
}

func (ctrl *controller) stopAlertHandler() {
close(ctrl.alertHandler.StopCh)
ctrl.alertHandler.StopCh <- struct {}{}
<-ctrl.alertHandler.DoneCh
}

0 comments on commit 7b28783

Please sign in to comment.