|
|
@ -3,6 +3,7 @@ package util |
|
|
|
import ( |
|
|
|
"context" |
|
|
|
"fmt" |
|
|
|
"net/http" |
|
|
|
"strconv" |
|
|
|
"strings" |
|
|
|
"sync" |
|
|
@ -18,6 +19,10 @@ var ( |
|
|
|
grpcClientsLock sync.Mutex |
|
|
|
) |
|
|
|
|
|
|
|
func init(){ |
|
|
|
http.DefaultTransport.(*http.Transport).MaxIdleConnsPerHost = 100 |
|
|
|
} |
|
|
|
|
|
|
|
func NewGrpcServer(opts ...grpc.ServerOption) *grpc.Server { |
|
|
|
var options []grpc.ServerOption |
|
|
|
options = append(options, grpc.KeepaliveParams(keepalive.ServerParameters{ |
|
|
|