From b85e6bb8b229a730050cd616cacd432dcda9612f Mon Sep 17 00:00:00 2001 From: Dmitry Patsura Date: Wed, 12 Jun 2019 22:49:00 +0300 Subject: Feature(rr): Serve - dont ignore error from container.Serve --- cmd/rr/cmd/serve.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/cmd/rr/cmd/serve.go b/cmd/rr/cmd/serve.go index 31dd6039..981ad12d 100644 --- a/cmd/rr/cmd/serve.go +++ b/cmd/rr/cmd/serve.go @@ -33,13 +33,13 @@ func init() { CLI.AddCommand(&cobra.Command{ Use: "serve", Short: "Serve RoadRunner service(s)", - Run: serveHandler, + RunE: serveHandler, }) signal.Notify(stopSignal, os.Interrupt, os.Kill, syscall.SIGTERM, syscall.SIGINT) } -func serveHandler(cmd *cobra.Command, args []string) { +func serveHandler(cmd *cobra.Command, args []string) error { stopped := make(chan interface{}) go func() { @@ -49,8 +49,9 @@ func serveHandler(cmd *cobra.Command, args []string) { }() if err := Container.Serve(); err != nil { - return + return err } <-stopped + return nil } -- cgit v1.2.3