From 88b3416e0cb795873787014906b48d184f8fe78a Mon Sep 17 00:00:00 2001 From: Wolfy-J Date: Sat, 23 Jun 2018 20:21:12 +0300 Subject: better shutdown --- cmd/rr/cmd/serve.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'cmd/rr') diff --git a/cmd/rr/cmd/serve.go b/cmd/rr/cmd/serve.go index 4ae2a9d9..dc751611 100644 --- a/cmd/rr/cmd/serve.go +++ b/cmd/rr/cmd/serve.go @@ -40,7 +40,10 @@ func init() { } func serveHandler(cmd *cobra.Command, args []string) error { - go Container.Serve() + go func() { + Container.Serve() + stopSignal <- nil + }() <-stopSignal Container.Stop() -- cgit v1.2.3