cmd/route-httpagent: attempt to be a bit more durable

This commit is contained in:
Cadey Ratio 2017-10-01 13:42:33 -07:00
parent eacd9781f7
commit 3ee292925d
No known key found for this signature in database
GPG Key ID: D607EE27C2E7F89A
1 changed files with 9 additions and 3 deletions

View File

@ -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)
for {
err := client.Connect()
if err != nil {
ln.FatalErr(context.Background(), err, ln.Action("http agent is now running"))
ln.Error(context.Background(), err, ln.Action("client connection failed"))
}
time.Sleep(2 * time.Second)
}
}