dbjobqueue: Filter maintenance queries based on results

Jobs that already had their results nulled, shouldn't be included in the
maintenance job.
This commit is contained in:
Sanne Raymaekers 2022-06-07 11:58:52 +02:00 committed by Ondřej Budai
parent 4827f0e83e
commit 8bfc6c9961
2 changed files with 2 additions and 2 deletions

View file

@ -104,7 +104,7 @@ const (
sqlQueryJobsUptoByType = `
SELECT array_agg(id), type
FROM jobs
WHERE type = ANY($1) AND finished_at < $2
WHERE type = ANY($1) AND finished_at < $2 AND result IS NOT NULL
GROUP BY type`
sqlDeleteJobResult = `
UPDATE jobs