Skip to content

Commit

Permalink
allowed singal.ErrStop
Browse files Browse the repository at this point in the history
  • Loading branch information
whiteCcinn committed May 25, 2021
1 parent 776ee01 commit 02a0ae9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions signal.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,12 @@ func ServeSignals() (err error) {
}

signal.Notify(ch, signals...)

loop:
for sig := range ch {
for _, f := range handlers[sig] {
err = f(sig)
if err == ErrStop {
err = nil
break loop
}
if err != nil {
break
Expand Down

0 comments on commit 02a0ae9

Please sign in to comment.