From b9d966ff903dfa025d24e5c79323086571bc750d Mon Sep 17 00:00:00 2001 From: vvzvlad Date: Sun, 19 Jan 2025 09:45:18 +0300 Subject: [PATCH] Update check_logs function in checker.py to retrieve logs from the 'infernet-node' container instead of using 'docker compose'. This change improves log retrieval efficiency by reducing the time window from 2 hours to 10 minutes, while also updating error handling to reflect the new command. Enhances clarity in log management for health checks. --- checker.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/checker.py b/checker.py index 1f0d589..996ae5e 100644 --- a/checker.py +++ b/checker.py @@ -118,10 +118,10 @@ class GRIST: def check_logs(log_handler): try: - logs = subprocess.run(['docker', 'compose', 'logs', '--since', '2h'], cwd='/root/node/', capture_output=True, text=True, check=True) + logs = subprocess.run(['docker', 'logs', '--since', '10m', 'infernet-node'], capture_output=True, text=True, check=True) log_content = logs.stdout except subprocess.CalledProcessError as e: - raise RuntimeError(f"Error running docker compose logs: {e}") from e + raise RuntimeError(f"Error running docker logs: {e}") from e subscription_pattern = r'Ignored subscription creation.*id=(\d+) err=Subscription completed' match = re.search(subscription_pattern, log_content)