Avoid erroring when processing emails again

These changes allow processing emails again, and just creating job and branch
entries where data is missing.
This commit is contained in:
Christopher Baines 2019-08-05 20:59:48 +01:00
parent 712dd377a1
commit 9e80bda4f9
7 changed files with 84 additions and 5 deletions

View file

@ -630,12 +630,15 @@ WHERE job_id = $1"
"
INSERT INTO load_new_guix_revision_jobs (git_repository_id, commit, source)
VALUES ($1, $2, $3)
ON CONFLICT DO NOTHING
RETURNING id;")
(first
(exec-query conn
query
(list git-repository-id commit source))))
(match (exec-query conn
query
(list git-repository-id commit source))
((result)
result)
(() #f)))
(define (select-job-for-commit conn commit)
(let ((result