This commit is contained in:
crusader 2018-03-29 18:02:43 +09:00
parent 4a4a6a7efa
commit 7c24503032

View File

@ -25,9 +25,15 @@ type GatewayRPCServletHandlers struct {
}
func (sh *GatewayRPCServletHandlers) Invoke(servletCTX rpc.ServletContext, requestCodec protocol.RegistryCodec) (result interface{}, err error) {
var (
grpcResult string
method string
params []string
)
defer func() {
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() {
@ -49,17 +55,13 @@ func (sh *GatewayRPCServletHandlers) Invoke(servletCTX rpc.ServletContext, reque
grpcCTX := metadata.NewOutgoingContext(context.Background(), md.(metadata.MD))
var (
grpcResult string
params []string
)
method = requestCodec.Method()
params, err = requestCodec.Params()
if nil != err {
return
}
grpcResult, err = grpc.Exec(grpcCTX, requestCodec.Method(), params)
grpcResult, err = grpc.Exec(grpcCTX, method, params)
if err != nil {
return
}