From 3ee292925d3fb0d4159015643544a6ae64e6de24 Mon Sep 17 00:00:00 2001 From: Christine Dodrill Date: Sun, 1 Oct 2017 13:42:33 -0700 Subject: [PATCH] cmd/route-httpagent: attempt to be a bit more durable --- cmd/route-httpagent/main.go | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/cmd/route-httpagent/main.go b/cmd/route-httpagent/main.go index 8c74581..12feafa 100644 --- a/cmd/route-httpagent/main.go +++ b/cmd/route-httpagent/main.go @@ -4,6 +4,7 @@ import ( "context" "crypto/tls" "flag" + "time" "git.xeserv.us/xena/route/internal/tun2" "github.com/Xe/ln" @@ -32,8 +33,13 @@ func main() { } client, _ := tun2.NewClient(cfg) - err := client.Connect() - if err != nil { - ln.FatalErr(context.Background(), err, ln.Action("http agent is now running")) + + for { + err := client.Connect() + if err != nil { + ln.Error(context.Background(), err, ln.Action("client connection failed")) + } + + time.Sleep(2 * time.Second) } }