mirror of
https://github.com/openimsdk/open-im-server.git
synced 2025-12-02 18:34:29 +08:00
optimization: change the configuration file from being read globally to being read independently.
This commit is contained in:
parent
27e472bf89
commit
5f2f56bcaf
@ -16,6 +16,7 @@ package startrpc
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"github.com/openimsdk/open-im-server/v3/pkg/common/config"
|
||||||
"net"
|
"net"
|
||||||
"testing"
|
"testing"
|
||||||
"time"
|
"time"
|
||||||
@ -25,7 +26,7 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
// mockRpcFn is a mock gRPC function for testing.
|
// mockRpcFn is a mock gRPC function for testing.
|
||||||
func mockRpcFn(client discoveryregistry.SvcDiscoveryRegistry, server *grpc.Server) error {
|
func mockRpcFn(config *config.GlobalConfig, client discoveryregistry.SvcDiscoveryRegistry, server *grpc.Server) error {
|
||||||
// Implement a mock gRPC service registration logic if needed
|
// Implement a mock gRPC service registration logic if needed
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
@ -40,7 +41,8 @@ func TestStart(t *testing.T) {
|
|||||||
doneChan := make(chan error, 1)
|
doneChan := make(chan error, 1)
|
||||||
|
|
||||||
go func() {
|
go func() {
|
||||||
err := Start(testRpcPort, testRpcRegisterName, testPrometheusPort, mockRpcFn)
|
err := Start(testRpcPort, testRpcRegisterName, testPrometheusPort,
|
||||||
|
config.NewGlobalConfig(), mockRpcFn)
|
||||||
doneChan <- err
|
doneChan <- err
|
||||||
}()
|
}()
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user