mirror of
https://github.com/openimsdk/open-im-server.git
synced 2025-04-25 19:22:46 +08:00
Merge branch 'errcode' of github.com:OpenIMSDK/Open-IM-Server into errcode
This commit is contained in:
commit
012a173629
@ -59,11 +59,16 @@ func Start(rpcPort int, rpcRegisterName string, prometheusPort int, rpcFn func(c
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}()
|
}()
|
||||||
|
|
||||||
|
err = rpcFn(zkClient, srv)
|
||||||
|
if err != nil {
|
||||||
|
return utils.Wrap1(err)
|
||||||
|
}
|
||||||
err = srv.Serve(listener)
|
err = srv.Serve(listener)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return utils.Wrap1(err)
|
return utils.Wrap1(err)
|
||||||
}
|
}
|
||||||
return rpcFn(zkClient, srv)
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
//func Start(rpcPort int, rpcRegisterName string, prometheusPort int, rpcFn func(client discoveryregistry.SvcDiscoveryRegistry, server *grpc.Server) error, options ...grpc.ServerOption) error {
|
//func Start(rpcPort int, rpcRegisterName string, prometheusPort int, rpcFn func(client discoveryregistry.SvcDiscoveryRegistry, server *grpc.Server) error, options ...grpc.ServerOption) error {
|
||||||
|
@ -64,10 +64,13 @@ func rpcClientInterceptor(ctx context.Context, method string, req, reply interfa
|
|||||||
if ok {
|
if ok {
|
||||||
md.Append(constant.OpUserID, opUserID)
|
md.Append(constant.OpUserID, opUserID)
|
||||||
}
|
}
|
||||||
|
log.Info("", "rpc come here")
|
||||||
err = invoker(metadata.NewOutgoingContext(ctx, md), method, req, reply, cc, opts...)
|
err = invoker(metadata.NewOutgoingContext(ctx, md), method, req, reply, cc, opts...)
|
||||||
if err == nil {
|
if err == nil {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
log.Info("", "rpc come here err")
|
||||||
|
|
||||||
rpcErr, ok := err.(interface{ GRPCStatus() *status.Status })
|
rpcErr, ok := err.(interface{ GRPCStatus() *status.Status })
|
||||||
if !ok {
|
if !ok {
|
||||||
return errs.NewCodeError(errs.DefaultOtherError, err.Error()).Wrap()
|
return errs.NewCodeError(errs.DefaultOtherError, err.Error()).Wrap()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user