feat: Optimizing RPC call (#2993)

* pb

* fix: Modifying other fields while setting IsPrivateChat does not take effect

* fix: quote message error revoke

* refactoring scheduled tasks

* refactoring scheduled tasks

* refactoring scheduled tasks

* refactoring scheduled tasks

* refactoring scheduled tasks

* refactoring scheduled tasks

* rpc client

* rpc client

* rpc client

* rpc client

* rpc client

* rpc client

* rpc client

* rpc client
This commit is contained in:
chao
2024-12-24 10:51:38 +08:00
committed by GitHub
parent e9895062cb
commit e3f609b3ae
67 changed files with 1287 additions and 1092 deletions
+4 -5
View File
@@ -29,7 +29,6 @@ import (
conf "github.com/openimsdk/open-im-server/v3/pkg/common/config"
kdisc "github.com/openimsdk/open-im-server/v3/pkg/common/discoveryregister"
"github.com/openimsdk/open-im-server/v3/pkg/common/prommetrics"
"github.com/openimsdk/open-im-server/v3/pkg/rpcclient"
"github.com/openimsdk/tools/discovery/etcd"
"github.com/openimsdk/tools/errs"
"github.com/openimsdk/tools/log"
@@ -64,9 +63,6 @@ func Start(ctx context.Context, index int, config *Config) error {
return errs.WrapMsg(err, "failed to register discovery service")
}
client.AddOption(mw.GrpcClient(), grpc.WithTransportCredentials(insecure.NewCredentials()), grpc.WithDefaultServiceConfig(fmt.Sprintf(`{"LoadBalancingPolicy": "%s"}`, "round_robin")))
if err = rpcclient.InitRpcCaller(client, config.Discovery.RpcService); err != nil {
return err
}
var (
netDone = make(chan struct{}, 1)
@@ -94,7 +90,10 @@ func Start(ctx context.Context, index int, config *Config) error {
return errs.New("only etcd support autoSetPorts", "RegisterName", "api").Wrap()
}
router := newGinRouter(client, config)
router, err := newGinRouter(ctx, client, config)
if err != nil {
return err
}
if config.API.Prometheus.Enable {
var (
listener net.Listener