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) { 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
} }