intesa_splunk/analyzer/analyzer_runner.py

10 lines
345 B
Python

import os, time, subprocess, pathlib
WATCH = int(os.getenv("WATCH_SECONDS","60"))
pathlib.Path(os.getenv("REPORT_DIR","/app/reports")).mkdir(parents=True, exist_ok=True)
while True:
try:
subprocess.run(["python","offline_analyzer.py"], check=True)
except Exception as e:
print("analyzer error:", e)
time.sleep(WATCH)