Files
hermes-agent/cron
kshitij 924074906e perf: precompute intervals outside lock, cache croniter, use _ensure_croniter
/simplify-code findings:
- Precompute job intervals OUTSIDE _running_lock in sweep_stale_inflight so
  croniter evaluation does not block try_register/release_running_job (efficiency HIGH).
- Add _cron_interval_cache so cron expression cadence is computed once, not
  every 60s tick (efficiency MEDIUM).
- Use cron.jobs._ensure_croniter() instead of bare 'from croniter import
  croniter' — reuses the existing lazy-import infrastructure (reuse HIGH).

Noted as follow-up (too invasive for salvage):
- Consolidate _cron_interval_minutes + _job_interval_minutes with existing
  _compute_grace_seconds in cron/jobs.py (reuse HIGH, cross-module refactor).
- Extract shared _append_jsonl helper from _record_forced_release +
  _write_usage_audit (reuse HIGH, touches existing code).
- Collapse _running_job_ids + _running_since + _running_futures into a single
  dict of records (quality HIGH, redesigns contributor's core structure).
2026-08-15 02:23:56 +05:30
..