mirror of
https://github.com/openimsdk/open-im-server.git
synced 2025-12-04 19:45:41 +08:00
refactor: add openim mysql to mongo refactor
Signed-off-by: Xinwei Xiong(cubxxw) <3293172751nss@gmail.com>
This commit is contained in:
parent
c69420e1f4
commit
d98f63734b
@ -46,15 +46,13 @@ func (a *RpcCmd) Exec() error {
|
|||||||
return a.Execute()
|
return a.Execute()
|
||||||
}
|
}
|
||||||
|
|
||||||
func (a *RpcCmd) StartSvr(
|
func (a *RpcCmd) StartSvr(name string, rpcFn func(discov discoveryregistry.SvcDiscoveryRegistry, server *grpc.Server) error,) error {
|
||||||
name string,
|
|
||||||
rpcFn func(discov discoveryregistry.SvcDiscoveryRegistry, server *grpc.Server) error,
|
|
||||||
) error {
|
|
||||||
if a.GetPortFlag() == 0 {
|
if a.GetPortFlag() == 0 {
|
||||||
return errors.New("port is required")
|
return errors.New("port is required")
|
||||||
}
|
}
|
||||||
return startrpc.Start(a.GetPortFlag(), name, a.GetPrometheusPortFlag(), rpcFn)
|
return startrpc.Start(a.GetPortFlag(), name, a.GetPrometheusPortFlag(), rpcFn)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (a *RpcCmd) GetPortFromConfig(portType string) int {
|
func (a *RpcCmd) GetPortFromConfig(portType string) int {
|
||||||
switch a.Name {
|
switch a.Name {
|
||||||
case RpcPushServer:
|
case RpcPushServer:
|
||||||
|
|||||||
@ -79,7 +79,6 @@ func NewUserDatabase(userDB relation.UserModelInterface, cache cache.UserCache,
|
|||||||
return &userDatabase{userDB: userDB, cache: cache, tx: tx, mongoDB: mongoDB}
|
return &userDatabase{userDB: userDB, cache: cache, tx: tx, mongoDB: mongoDB}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
func (u *userDatabase) InitOnce(ctx context.Context, users []*relation.UserModel) error {
|
func (u *userDatabase) InitOnce(ctx context.Context, users []*relation.UserModel) error {
|
||||||
// Extract user IDs from the given user models.
|
// Extract user IDs from the given user models.
|
||||||
userIDs := utils.Slice(users, func(e *relation.UserModel) string {
|
userIDs := utils.Slice(users, func(e *relation.UserModel) string {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user