From e1e255b138999bd7f509b38bae9e4d723bfecd4a Mon Sep 17 00:00:00 2001 From: Christine Dodrill Date: Thu, 5 Oct 2017 13:15:24 -0700 Subject: [PATCH] plugins/autohttpagent: retry everything --- plugins/autohttpagent/main.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/plugins/autohttpagent/main.go b/plugins/autohttpagent/main.go index d2d8de2..c8cf89d 100644 --- a/plugins/autohttpagent/main.go +++ b/plugins/autohttpagent/main.go @@ -32,7 +32,7 @@ func mustEnv(key string, def string) string { return val } -func doHttpAgent() { +func doHTTPAgent() { go func() { ctx, cancel := context.WithCancel(context.Background()) defer cancel() @@ -47,17 +47,17 @@ func doHttpAgent() { } client, _ := tun2.NewClient(cfg) - err := client.Connect() + err := client.Connect(ctx) if err != nil { ln.Error(ctx, err, ln.Action("client connection error, restarting")) time.Sleep(5 * time.Second) - doHttpAgent() + doHTTPAgent() } }() } func init() { - doHttpAgent() + doHTTPAgent() }