Skip to content
This repository has been archived by the owner on Nov 1, 2022. It is now read-only.

Commit

Permalink
Add buffer to channel for Notify
Browse files Browse the repository at this point in the history
Package signal will not block sending to c: the caller must ensure that c has sufficient buffer space to keep up with the expected signal rate.
See https://golang.org/pkg/os/signal/#Notify
  • Loading branch information
lelenanam committed Oct 8, 2018
1 parent 5648746 commit 2162c3e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion cmd/fluxd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@ func main() {
shutdownWg := &sync.WaitGroup{}

go func() {
c := make(chan os.Signal)
c := make(chan os.Signal, 1)
signal.Notify(c, syscall.SIGINT, syscall.SIGTERM)
errc <- fmt.Errorf("%s", <-c)
}()
Expand Down
2 changes: 1 addition & 1 deletion cmd/helm-operator/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ func main() {
shutdownWg := &sync.WaitGroup{}

go func() {
c := make(chan os.Signal)
c := make(chan os.Signal, 1)
signal.Notify(c, syscall.SIGINT, syscall.SIGTERM)
errc <- fmt.Errorf("%s", <-c)
}()
Expand Down

0 comments on commit 2162c3e

Please sign in to comment.