aboutsummaryrefslogtreecommitdiff
path: root/guix-data-service/model
diff options
context:
space:
mode:
authorChristopher Baines <mail@cbaines.net>2021-02-05 11:07:31 +0000
committerChristopher Baines <mail@cbaines.net>2021-02-05 11:07:31 +0000
commitb7ba8d0c2ca3aca9ba5b5f9f27b9778ee949d20e (patch)
treedd106b1f11ee883106d724e33c1e3044783ef9d6 /guix-data-service/model
parent07f903abaf7efb87e9984ce64dce6f26776c415d (diff)
downloaddata-service-b7ba8d0c2ca3aca9ba5b5f9f27b9778ee949d20e.tar
data-service-b7ba8d0c2ca3aca9ba5b5f9f27b9778ee949d20e.tar.gz
Fix comparing by datetime
When the latest revisions haven't been processed successfully yet.
Diffstat (limited to 'guix-data-service/model')
-rw-r--r--guix-data-service/model/guix-revision.scm14
1 files changed, 10 insertions, 4 deletions
diff --git a/guix-data-service/model/guix-revision.scm b/guix-data-service/model/guix-revision.scm
index f7dc26a..2ebeacc 100644
--- a/guix-data-service/model/guix-revision.scm
+++ b/guix-data-service/model/guix-revision.scm
@@ -100,13 +100,19 @@ FROM guix_revisions
INNER JOIN git_branches
ON git_branches.commit = guix_revisions.commit
AND git_branches.git_repository_id = guix_revisions.git_repository_id
-WHERE git_branches.name = $1 AND git_branches.datetime <= $2
+INNER JOIN load_new_guix_revision_jobs
+ ON load_new_guix_revision_jobs.commit = guix_revisions.commit
+WHERE git_branches.name = $1
+ AND git_branches.datetime <= $2
+ AND load_new_guix_revision_jobs.succeeded_at IS NOT NULL
ORDER BY git_branches.datetime DESC
LIMIT 1")
- (car
- (exec-query conn query (list branch
- (date->string datetime "~1 ~3")))))
+ (match (exec-query conn query
+ (list branch
+ (date->string datetime "~1 ~3")))
+ (() #f)
+ ((result) result)))
(define (guix-revisions-cgit-url-bases conn guix-revision-ids)
(map