diff --git a/main.go b/main.go index 41b6079..5fcd495 100644 --- a/main.go +++ b/main.go @@ -127,6 +127,8 @@ func handle() { panic(err) } + tr = &http.Transport{MaxIdleConns: 1000, MaxIdleConnsPerHost: 100} + // in advance can take out the address id,prevent limiting get fail if aid == "" { if aid = addressId(); aid == "" { @@ -135,8 +137,6 @@ func handle() { log.Println("获取收货人信息:" + aid) } - tr = &http.Transport{MaxIdleConns: 1000, MaxIdleConnsPerHost: 100} - } func execute(ctx context.Context, task func()) {