Skip to content
This repository has been archived by the owner on Apr 11, 2024. It is now read-only.

Commit

Permalink
Merge pull request #134 from mercari/fix_sig_chan_close_infinit_loop
Browse files Browse the repository at this point in the history
fix infinite loop if channel is close
  • Loading branch information
catatsuy committed Oct 11, 2019
2 parents 28b13a8 + 9efc264 commit 0f947dc
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions cmd/gaurun/gaurun.go
Original file line number Diff line number Diff line change
Expand Up @@ -179,13 +179,10 @@ func main() {
}

func signalHandler(ch <-chan os.Signal, sighupFn func()) {
for {
select {
case sig := <-ch:
switch sig {
case syscall.SIGHUP:
sighupFn()
}
for sig := range ch {
switch sig {
case syscall.SIGHUP:
sighupFn()
}
}
}

0 comments on commit 0f947dc

Please sign in to comment.