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

2
.gitignore vendored
View File

@@ -60,8 +60,6 @@ temp/
docs/site/
docs/.mkdocs_cache/
# Docker
.dockerignore
# OS-specific
Thumbs.db

Binary file not shown.

Binary file not shown.

View File

@@ -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 audit service and gRPC server (defined in audit_service_fx.go)

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

View File

@@ -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 authz service and gRPC server (defined in authz_service_fx.go)

View File

@@ -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)