From d747e9b43567a3d30bcafbcdd815a847d15269ef Mon Sep 17 00:00:00 2001 From: Ilja Heitlager Date: Wed, 23 Dec 2015 21:34:12 +0100 Subject: [PATCH] Reverse the ping option --- cmd/cmd.go | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/cmd/cmd.go b/cmd/cmd.go index 8e13b87b..f37089b8 100644 --- a/cmd/cmd.go +++ b/cmd/cmd.go @@ -15,6 +15,7 @@ import ( "text/template" "time" + log "github.com/golang/glog" "github.com/codegangsta/cli" "github.com/micro/go-micro/broker" "github.com/micro/go-micro/client" @@ -100,9 +101,9 @@ var ( }, cli.BoolFlag{ - Name: "disable_ping", - EnvVar: "MICRO_DISABLE_PING", - Usage: "Disable ping", + Name: "enable_ping", + EnvVar: "MICRO_ENABLE_PING", + Usage: "Enable ping", }, // logging flags @@ -180,6 +181,7 @@ func ping() { cl := &http.Client{} fn := func() { + log.Infof("Ping micro-services.co") p.Timestamp = time.Now().Unix() b, err := json.Marshal(p) if err != nil { @@ -255,7 +257,7 @@ func Setup(c *cli.Context) error { client.DefaultClient = client.NewClient() - if !c.Bool("disable_ping") { + if c.Bool("enable_ping") { go ping() }