diff --git a/pkg/common/cmd/rpc.go b/pkg/common/cmd/rpc.go index 6266c03b2..094a0e60a 100644 --- a/pkg/common/cmd/rpc.go +++ b/pkg/common/cmd/rpc.go @@ -46,15 +46,13 @@ func (a *RpcCmd) Exec() error { return a.Execute() } -func (a *RpcCmd) StartSvr( - name string, - rpcFn func(discov discoveryregistry.SvcDiscoveryRegistry, server *grpc.Server) error, -) error { +func (a *RpcCmd) StartSvr(name string, rpcFn func(discov discoveryregistry.SvcDiscoveryRegistry, server *grpc.Server) error,) error { if a.GetPortFlag() == 0 { return errors.New("port is required") } return startrpc.Start(a.GetPortFlag(), name, a.GetPrometheusPortFlag(), rpcFn) } + func (a *RpcCmd) GetPortFromConfig(portType string) int { switch a.Name { case RpcPushServer: diff --git a/pkg/common/db/controller/user.go b/pkg/common/db/controller/user.go index 6299e7e87..f93659fda 100644 --- a/pkg/common/db/controller/user.go +++ b/pkg/common/db/controller/user.go @@ -79,7 +79,6 @@ func NewUserDatabase(userDB relation.UserModelInterface, cache cache.UserCache, return &userDatabase{userDB: userDB, cache: cache, tx: tx, mongoDB: mongoDB} } - func (u *userDatabase) InitOnce(ctx context.Context, users []*relation.UserModel) error { // Extract user IDs from the given user models. userIDs := utils.Slice(users, func(e *relation.UserModel) string {