From e67aa518fa7e260e368da9ddef3b73db2cc70f12 Mon Sep 17 00:00:00 2001 From: nguu0123 Date: Thu, 15 Feb 2024 14:01:59 +0200 Subject: [PATCH] refactor --- observability/ODOP_Ob/CSC_monitoring_service.py | 3 ++- observability/ODOP_Ob/ODOP_ObService.py | 7 ++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/observability/ODOP_Ob/CSC_monitoring_service.py b/observability/ODOP_Ob/CSC_monitoring_service.py index c5a9b8d..2be2147 100644 --- a/observability/ODOP_Ob/CSC_monitoring_service.py +++ b/observability/ODOP_Ob/CSC_monitoring_service.py @@ -46,4 +46,5 @@ async def subscribe(serviceUrl: ServiceUrl): if __name__ == "__main__": # start_subscription() - uvicorn.run(app, host="localhost", port=8001) + uvicorn.run(app, host="localhost", port=8001) + uvicorn.run("CSC_monitoring_service:app", host="localhost", port=8001, reload=True) diff --git a/observability/ODOP_Ob/ODOP_ObService.py b/observability/ODOP_Ob/ODOP_ObService.py index 5d22931..bab60c4 100644 --- a/observability/ODOP_Ob/ODOP_ObService.py +++ b/observability/ODOP_Ob/ODOP_ObService.py @@ -84,7 +84,8 @@ async def metric(resourceUsage: ResourceUsage): raise HTTPException(status_code=400, detail=str(e)) +odopObsService = ODOPObsService() +app.include_router(odopObsService.router) + if __name__ == "__main__": - odopObsService = ODOPObsService() - app.include_router(odopObsService.router) - uvicorn.run(app, host="localhost", port=8000) + uvicorn.run("ODOP_ObService:app", host="localhost", port=8000, reload=True)