Fix new services implementation 9

This commit is contained in:
Urtzi Alfaro
2025-08-16 08:00:52 +02:00
parent 055ce10c66
commit 9de0f9943c
5 changed files with 37 additions and 83 deletions

View File

@@ -32,10 +32,6 @@ async def lifespan(app: FastAPI):
await init_db()
logger.info("Database initialized successfully")
# Setup metrics
setup_metrics_early(app, "suppliers-service")
logger.info("Metrics setup completed")
yield
except Exception as e:
@@ -72,6 +68,12 @@ app.add_middleware(
allow_headers=["*"],
)
# Setup metrics
try:
setup_metrics_early(app, "suppliers-service")
logger.info("Metrics setup completed")
except Exception as e:
logger.error("Metrics setup failed", error=str(e))
# Setup authentication middleware (commented out - not implemented)
# setup_auth_middleware(app)