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.

This commit is contained in:
vvzvlad 2025-01-19 09:45:18 +03:00
parent 1e38b5aca6
commit b9d966ff90

View File

@ -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)