diff options
author | Wolfy-J <[email protected]> | 2019-01-05 12:21:37 +0300 |
---|---|---|
committer | Wolfy-J <[email protected]> | 2019-01-05 12:21:37 +0300 |
commit | 46009112a783a1fdae95e0a061d4c8c41a1c8ff1 (patch) | |
tree | a34cf8ad465e9f354723f855c531ea1db3235cbd /cmd | |
parent | d5e5be00aca87ea39ece9c04efe7dc354b1dc3f6 (diff) |
first set of patches
Diffstat (limited to 'cmd')
-rw-r--r-- | cmd/rr/cmd/serve.go | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/cmd/rr/cmd/serve.go b/cmd/rr/cmd/serve.go index 8028395a..31dd6039 100644 --- a/cmd/rr/cmd/serve.go +++ b/cmd/rr/cmd/serve.go @@ -36,14 +36,21 @@ func init() { Run: serveHandler, }) - signal.Notify(stopSignal, os.Interrupt, os.Kill, syscall.SIGTERM) + signal.Notify(stopSignal, os.Interrupt, os.Kill, syscall.SIGTERM, syscall.SIGINT) } func serveHandler(cmd *cobra.Command, args []string) { + stopped := make(chan interface{}) + go func() { <-stopSignal Container.Stop() + close(stopped) }() - Container.Serve() + if err := Container.Serve(); err != nil { + return + } + + <-stopped } |