Poll Log — technical
Poll Log — technical
Route GET /ro/poll-log in app/ro.py (poll_log_screen), template templates/ro_poll_log.html, jump-bar entry in base.html (ro_nav_screens includes ro_poll_log). Requires the ro_view action like every RO screen.
Table (RO database)
`` ro_poll_log (poll_id bigserial pk, started_at timestamptz, finished_at timestamptz, source_system text FP|BT, trigger text cron|manual, outcome text ok|error|skipped, scanned int, staged int, skipped int, detail text) index ro_poll_log_started_idx (started_at desc) ``
Writer
skills/requirements_orders/scripts/ro_poll_runner.py (Viktor cron /logistics/ro-intake-poll, hourly :07) — log_poll() writes one row per source per tick:
- skipped only when the source interval is > 0 and not yet due (off = no row);
- ok after all pass scripts exit 0 (same moment
fp_poll_last_at/bt_poll_last_atis stamped); - error when a pass exits non-zero, or — via
crash_alert()aroundmain()— when the runner itself raises. Counts are regexed from the FP watcher stdout (PM jobs scanned: N,new: N | skipped: N,staged inbox_id N); BT rows carry no counts yet. trigger=manualwhen run with--only.
Failures are never allowed to break the sweep (log_poll swallows its own exceptions).
Alerting (two independent paths)
- Runner:
alert()DMs Dave (U9RTEG3A6), throttled byro_poll_last_alert_at(6h). Since 2026-09-17 the runner re-execs underuv run --with psycopg2-binary …when the driver is missing, andcrash_alert()catches anything escapingmain(). skills/im2_app/scripts/check_auto_po.py(cron/logistics/auto-po-watchdog, every 15 min) printsPOLL_FP=OK|STALE|OFF/POLL_BT=…: STALE when*_poll_hours > 0and the last clean stamp is older than2 × interval + 1h(or missing). The cron DMs Dave once per episode.
History
2026-09-11 03:10 → 2026-09-17 23:10 UTC: 164 consecutive ticks failed on ModuleNotFoundError: psycopg2 at import, before the alert code — no DM, nothing staged. Backfilled as a single summary error row (poll_id 3). Catch-up manual sweeps logged as rows 4-5.