ing
This commit is contained in:
parent
4a4a6a7efa
commit
7c24503032
|
@ -25,9 +25,15 @@ type GatewayRPCServletHandlers struct {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (sh *GatewayRPCServletHandlers) Invoke(servletCTX rpc.ServletContext, requestCodec protocol.RegistryCodec) (result interface{}, err error) {
|
func (sh *GatewayRPCServletHandlers) Invoke(servletCTX rpc.ServletContext, requestCodec protocol.RegistryCodec) (result interface{}, err error) {
|
||||||
|
var (
|
||||||
|
grpcResult string
|
||||||
|
method string
|
||||||
|
params []string
|
||||||
|
)
|
||||||
|
|
||||||
defer func() {
|
defer func() {
|
||||||
if nil != err {
|
if nil != err {
|
||||||
logging.Logger().Errorf("Gateway Websocket: Inovke error %v", err)
|
logging.Logger().Errorf("Gateway Websocket: Method[%s] Params[%v] Inovke error %v", method, params, err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if !requestCodec.HasResponse() {
|
if !requestCodec.HasResponse() {
|
||||||
|
@ -49,17 +55,13 @@ func (sh *GatewayRPCServletHandlers) Invoke(servletCTX rpc.ServletContext, reque
|
||||||
|
|
||||||
grpcCTX := metadata.NewOutgoingContext(context.Background(), md.(metadata.MD))
|
grpcCTX := metadata.NewOutgoingContext(context.Background(), md.(metadata.MD))
|
||||||
|
|
||||||
var (
|
method = requestCodec.Method()
|
||||||
grpcResult string
|
|
||||||
params []string
|
|
||||||
)
|
|
||||||
|
|
||||||
params, err = requestCodec.Params()
|
params, err = requestCodec.Params()
|
||||||
if nil != err {
|
if nil != err {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
grpcResult, err = grpc.Exec(grpcCTX, requestCodec.Method(), params)
|
grpcResult, err = grpc.Exec(grpcCTX, method, params)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user