fix(datapolicy): read running TimescaleDB jobs

A running job reports -infinity as its next start, which failed the
storage overview and, intermittently, its test.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017GpWAskjmYtZpuQ5JwYTX3
This commit is contained in:
Sebastian UnterschützandClaude Opus 5.5 committed 2026-11-22 21:40:25 +01:00
1 parent e4ce619fbe
commit 98fb5d3a82
1 file changed
+3 -1
+3 -1
View File
@@ -88,7 +88,9 @@ func Collect(ctx context.Context, pool *pgxpool.Pool) (Stats, error) {
rows, err = pool.Query(ctx, `
SELECT j.job_id, j.proc_name, coalesce(j.hypertable_name, ''), coalesce(st.last_run_status, ''),
st.last_run_started_at, st.next_start, coalesce(st.total_failures, 0)
-- A running job reports -infinity as its next start.
nullif(nullif(st.last_run_started_at, '-infinity'), 'infinity'),
nullif(nullif(st.next_start, '-infinity'), 'infinity'), coalesce(st.total_failures, 0)
FROM timescaledb_information.jobs j
LEFT JOIN timescaledb_information.job_stats st USING (job_id)
WHERE j.proc_name LIKE 'policy_%' AND j.proc_name <> 'policy_telemetry'