Fix monitoring thread when refresh period is -1 17/14517/1
authorgarciadeblas <gerardo.garciadeblas@telefonica.com>
Mon, 19 Aug 2024 08:01:08 +0000 (08:01 +0000)
committergarciadeblas <gerardo.garciadeblas@telefonica.com>
Mon, 19 Aug 2024 08:01:08 +0000 (08:01 +0000)
Change-Id: Ib26177052e6c7daa2ec9e92e1532cc8dd985493a
Signed-off-by: garciadeblas <gerardo.garciadeblas@telefonica.com>
Dockerfile
NG-RO/osm_ng_ro/monitor.py

index 27ab273..ea19e3d 100644 (file)
@@ -41,5 +41,5 @@ RUN DEBIAN_FRONTEND=noninteractive apt-get update && \
         python3-pip \
         tox
 
-ENV LC_ALL C.UTF-8
-ENV LANG C.UTF-8
+ENV LC_ALL=C.UTF-8
+ENV LANG=C.UTF-8
index 34af39e..8099eb9 100644 (file)
@@ -900,6 +900,8 @@ def start_monitoring(config: dict):
     instance = MonitorVms(config)
     period = instance.refresh_config.active
     instance.run()
+    if period == -1:
+        period = 10 * 24 * 60 * 60  # 10 days (big enough)
     monitoring_task = threading.Timer(period, start_monitoring, args=(config,))
     monitoring_task.start()