From 6998aa4997c601ba516f240570dc939abaf5556d Mon Sep 17 00:00:00 2001 From: Dmytro Date: Tue, 5 Nov 2024 16:19:36 +0000 Subject: [PATCH] Increase METRICS_CHECK_INTERVAL, add additional sleep --- metrics/src/config.py | 2 +- metrics/src/main.py | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/metrics/src/config.py b/metrics/src/config.py index fc2b07c..70e4b86 100644 --- a/metrics/src/config.py +++ b/metrics/src/config.py @@ -50,7 +50,7 @@ NGINX_WWW_FOLDER = os.path.join(PROJECT_PATH, 'www') METRICS_FILEPATH = os.path.join(NGINX_WWW_FOLDER, 'metrics.json') -METRICS_CHECK_INTERVAL = 300 +METRICS_CHECK_INTERVAL = 600 METRICS_ERROR_CHECK_INTERVAL = 30 API_ERROR_TIMEOUT = 2 API_ERROR_RETRIES = 3 diff --git a/metrics/src/main.py b/metrics/src/main.py index 62bdabb..0a1d558 100644 --- a/metrics/src/main.py +++ b/metrics/src/main.py @@ -64,6 +64,7 @@ def run_metrics_loop(): current_date = datetime.now().date() if last_run_date is None or current_date > last_run_date: + sleep(METRICS_CHECK_INTERVAL) logger.info(f'Daily metrics collection started for {NETWORK_NAME}...') try: with db.connection_context():