fix(services): Fix duplicate health registry provider
- Change from fx.Provide to fx.Invoke for health registry registration - CoreModule() already provides *health.Registry - Services should register their database checkers with the existing registry - Use fx.Invoke to register database health checkers instead of providing new registry - Fixes duplicate provider error for *health.Registry - All services now build and should start successfully
This commit is contained in:
@@ -107,11 +107,9 @@ func main() {
|
||||
return client, nil
|
||||
}),
|
||||
|
||||
// Health registry with database checker
|
||||
fx.Provide(func(db *database.Client, log logger.Logger) (*healthpkg.Registry, error) {
|
||||
registry := healthpkg.NewRegistry()
|
||||
// Register database health checker with existing health registry
|
||||
fx.Invoke(func(registry *healthpkg.Registry, db *database.Client) {
|
||||
registry.Register("database", healthpkg.NewDatabaseChecker(db))
|
||||
return registry, nil
|
||||
}),
|
||||
|
||||
// Provide identity service and gRPC server (defined in identity_service_fx.go)
|
||||
|
||||
Reference in New Issue
Block a user