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:
1 parent
e4ce619fbe
commit
98fb5d3a82
1 file changed
+3
-1
@@ -88,7 +88,9 @@ func Collect(ctx context.Context, pool *pgxpool.Pool) (Stats, error) {
|
|||||||
|
|
||||||
rows, err = pool.Query(ctx, `
|
rows, err = pool.Query(ctx, `
|
||||||
SELECT j.job_id, j.proc_name, coalesce(j.hypertable_name, ''), coalesce(st.last_run_status, ''),
|
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
|
FROM timescaledb_information.jobs j
|
||||||
LEFT JOIN timescaledb_information.job_stats st USING (job_id)
|
LEFT JOIN timescaledb_information.job_stats st USING (job_id)
|
||||||
WHERE j.proc_name LIKE 'policy_%' AND j.proc_name <> 'policy_telemetry'
|
WHERE j.proc_name LIKE 'policy_%' AND j.proc_name <> 'policy_telemetry'
|
||||||
|
|||||||
Reference in new issue
Block a user