TLS连接增加握手超时检查

This commit is contained in:
GoEdgeLab
2021-12-18 19:17:40 +08:00
parent 32c5639452
commit 413c0851a8
8 changed files with 60 additions and 17 deletions

View File

@@ -134,9 +134,9 @@ func (this *SyncAPINodesTask) testEndpoints(endpoints []string) bool {
return
}
ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second)
ctx, cancelFunc := context.WithTimeout(context.Background(), 5*time.Second)
defer func() {
cancel()
cancelFunc()
}()
var conn *grpc.ClientConn
if u.Scheme == "http" {