summaryrefslogtreecommitdiff
path: root/cmd
diff options
context:
space:
mode:
authorDmitry Patsura <[email protected]>2019-06-12 22:49:00 +0300
committerDmitry Patsura <[email protected]>2019-06-12 22:49:00 +0300
commitb85e6bb8b229a730050cd616cacd432dcda9612f (patch)
tree18c1212bbc00487832633dfcd7a462ff10c5af15 /cmd
parent00abe6b1f26e9def03e7f1ac1b536ec9433370a9 (diff)
Feature(rr): Serve - dont ignore error from container.Serve
Diffstat (limited to 'cmd')
-rw-r--r--cmd/rr/cmd/serve.go7
1 files 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
}