plugins/autohttpagent: fix for ln api change

This commit is contained in:
Cadey Ratio 2017-10-01 08:14:54 -07:00
parent 334f483574
commit 9b56d5f1ce
No known key found for this signature in database
GPG Key ID: D607EE27C2E7F89A
1 changed files with 7 additions and 3 deletions

View File

@ -1,6 +1,9 @@
// +build linux
package main
import (
"context"
"crypto/tls"
"log"
"os"
@ -31,6 +34,9 @@ func mustEnv(key string, def string) string {
func doHttpAgent() {
go func() {
ctx, cancel := context.WithCancel(context.Background())
defer cancel()
cfg := &tun2.ClientConfig{
TLSConfig: &tls.Config{},
ConnType: connMethod,
@ -43,9 +49,7 @@ func doHttpAgent() {
client, _ := tun2.NewClient(cfg)
err := client.Connect()
if err != nil {
ln.Error(err, ln.F{
"action": "client_running",
})
ln.Error(ctx, err, ln.Action("client connection error, restarting"))
time.Sleep(5 * time.Second)