From 62c8bd1060e8a01066084b5f199fd0e2469eadc0 Mon Sep 17 00:00:00 2001 From: garciadeblas Date: Mon, 19 Aug 2024 08:01:08 +0000 Subject: [PATCH] Fix monitoring thread when refresh period is -1 Change-Id: Ib26177052e6c7daa2ec9e92e1532cc8dd985493a Signed-off-by: garciadeblas --- Dockerfile | 4 ++-- NG-RO/osm_ng_ro/monitor.py | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 27ab273a..ea19e3dd 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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 diff --git a/NG-RO/osm_ng_ro/monitor.py b/NG-RO/osm_ng_ro/monitor.py index 34af39ec..8099eb98 100644 --- a/NG-RO/osm_ng_ro/monitor.py +++ b/NG-RO/osm_ng_ro/monitor.py @@ -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() -- 2.25.1