Skip to content

Commit

Permalink
address comments
Browse files Browse the repository at this point in the history
Signed-off-by: nolouch <[email protected]>
  • Loading branch information
nolouch committed Dec 14, 2022
1 parent b4df235 commit 5221dab
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions pkg/msc/registry/registry.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
// limitations under the License.

// Package registry is used to register the services.
// TODO: Remove the `pd/server dependencies
// TODO: Use `uber/fx` to manage the lifecycle of services.
// TODO: Remove the `pd/server` dependencies
// TODO: Use the `uber/fx` to manage the lifecycle of services.
package registry

import (
Expand All @@ -41,7 +41,7 @@ type RegistrableService interface {
}

// ServiceRegistry is a map that stores all registered grpc services.
// It implements the `server.Serviceregistry` interface.
// It implements the `Serviceregistry` interface.
type ServiceRegistry struct {
builders map[string]ServiceBuilder
services map[string]RegistrableService
Expand All @@ -59,11 +59,12 @@ func (r *ServiceRegistry) InstallAllGRPCServices(srv *server.Server, g *grpc.Ser
for name, builder := range r.builders {
if l, ok := r.services[name]; ok {
l.RegisterGRPCService(g)
log.Info("gRPC service already registered", zap.String("service-name", name))
continue
}
l := builder(srv)
l.RegisterGRPCService(g)
log.Info("grpc service registered", zap.String("service-name", name))
log.Info("gRPC service register success", zap.String("service-name", name))
}
}

Expand Down

0 comments on commit 5221dab

Please sign in to comment.