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:
2025-11-06 21:00:52 +01:00
parent dfe460cb03
commit 4cac2b2592
7 changed files with 8 additions and 18 deletions

View File

@@ -109,11 +109,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
}),
// Identity Service client