aboutsummaryrefslogtreecommitdiff
path: root/guix-data-service
diff options
context:
space:
mode:
authorChristopher Baines <mail@cbaines.net>2019-10-02 21:54:11 +0100
committerChristopher Baines <mail@cbaines.net>2019-10-02 21:54:11 +0100
commit427063c812e77885e5728aa5a8f4ee27f11bd2b0 (patch)
treecc91414d9cdb8803352f36490db299ca4e1264e6 /guix-data-service
parente00aabde4388c014778475966da2b7021dfef560 (diff)
downloaddata-service-427063c812e77885e5728aa5a8f4ee27f11bd2b0.tar
data-service-427063c812e77885e5728aa5a8f4ee27f11bd2b0.tar.gz
Make it easier to retry jobs
Add a new event 'retry', and run jobs where the number of retry events is greater or equal to the number of failure events. Also add an index to the git_branches table to make the finding jobs query a bit faster.
Diffstat (limited to 'guix-data-service')
-rw-r--r--guix-data-service/jobs/load-new-guix-revision.scm9
1 files changed, 6 insertions, 3 deletions
diff --git a/guix-data-service/jobs/load-new-guix-revision.scm b/guix-data-service/jobs/load-new-guix-revision.scm
index 11db7ca..569ff62 100644
--- a/guix-data-service/jobs/load-new-guix-revision.scm
+++ b/guix-data-service/jobs/load-new-guix-revision.scm
@@ -1130,10 +1130,13 @@ SELECT
FROM load_new_guix_revision_jobs
WHERE
succeeded_at IS NULL AND
- NOT EXISTS (
- SELECT 1
+ (
+ SELECT COUNT(*)
+ FROM load_new_guix_revision_job_events
+ WHERE job_id = load_new_guix_revision_jobs.id AND event = 'retry'
+ ) >= (
+ SELECT COUNT(*)
FROM load_new_guix_revision_job_events
- -- Skip jobs that have failed, to avoid trying them over and over again
WHERE job_id = load_new_guix_revision_jobs.id AND event = 'failure'
)
ORDER BY latest_branch_commit DESC, id DESC