diff --git a/cron/jobs.py b/cron/jobs.py index c405d1a6d4..47e0b66efa 100644 --- a/cron/jobs.py +++ b/cron/jobs.py @@ -31,7 +31,7 @@ except ImportError: # Configuration # ============================================================================= -HERMES_DIR = get_hermes_home() +HERMES_DIR = get_hermes_home().resolve() CRON_DIR = HERMES_DIR / "cron" JOBS_FILE = CRON_DIR / "jobs.json" OUTPUT_DIR = CRON_DIR / "output" @@ -338,10 +338,12 @@ def load_jobs() -> List[Dict[str, Any]]: save_jobs(jobs) logger.warning("Auto-repaired jobs.json (had invalid control characters)") return jobs - except Exception: - return [] - except IOError: - return [] + except Exception as e: + logger.error("Failed to auto-repair jobs.json: %s", e) + raise RuntimeError(f"Cron database corrupted and unrepairable: {e}") from e + except IOError as e: + logger.error("IOError reading jobs.json: %s", e) + raise RuntimeError(f"Failed to read cron database: {e}") from e def save_jobs(jobs: List[Dict[str, Any]]):