@ -57,7 +57,7 @@ func run(port int) error {
if err != nil {
return err
}
if client.CreateRpcRootNodes(config.GetServiceNames()); err != nil {
if err := client.CreateRpcRootNodes(config.GetServiceNames()); err != nil {
fmt.Println("api init discov client success")
@ -16,7 +16,7 @@ import (
)
func GrpcClient() grpc.DialOption {
return grpc.WithUnaryInterceptor(RpcClientInterceptor)
return grpc.WithChainUnaryInterceptor(RpcClientInterceptor)
func RpcClientInterceptor(ctx context.Context, method string, req, resp interface{}, cc *grpc.ClientConn, invoker grpc.UnaryInvoker, opts ...grpc.CallOption) (err error) {
@ -153,5 +153,5 @@ func RpcServerInterceptor(ctx context.Context, req interface{}, info *grpc.Unary
func GrpcServer() grpc.ServerOption {
return grpc.UnaryInterceptor(RpcServerInterceptor)
return grpc.ChainUnaryInterceptor(RpcServerInterceptor)