diff options
author | Christopher Baines <mail@cbaines.net> | 2020-09-20 18:38:39 +0100 |
---|---|---|
committer | Christopher Baines <mail@cbaines.net> | 2020-09-20 18:38:39 +0100 |
commit | 857ac36711d84ab3dab5b73fc5f25f158a1af3b9 (patch) | |
tree | 8093f89959ebd84348e681b44073faab16fe2d53 | |
parent | e38db9eed95de0f286e666b630d082ddb9e263ce (diff) | |
download | data-service-857ac36711d84ab3dab5b73fc5f25f158a1af3b9.tar data-service-857ac36711d84ab3dab5b73fc5f25f158a1af3b9.tar.gz |
Return a number from count-guix-revisions
-rw-r--r-- | guix-data-service/model/guix-revision.scm | 8 | ||||
-rw-r--r-- | guix-data-service/web/controller.scm | 5 |
2 files changed, 5 insertions, 8 deletions
diff --git a/guix-data-service/model/guix-revision.scm b/guix-data-service/model/guix-revision.scm index 4dd4100..1cde5e2 100644 --- a/guix-data-service/model/guix-revision.scm +++ b/guix-data-service/model/guix-revision.scm @@ -30,10 +30,10 @@ guix-revisions-cgit-url-bases)) (define (count-guix-revisions conn) - (first - (exec-query - conn - "SELECT COUNT(*) FROM guix_revisions"))) + (match (exec-query + conn + "SELECT COUNT(*) FROM guix_revisions") + (((x)) (string->number x)))) (define (most-recent-n-guix-revisions conn n) (exec-query conn "SELECT * FROM guix_revisions ORDER BY id DESC LIMIT 10")) diff --git a/guix-data-service/web/controller.scm b/guix-data-service/web/controller.scm index a9a8a3e..863805f 100644 --- a/guix-data-service/web/controller.scm +++ b/guix-data-service/web/controller.scm @@ -348,10 +348,7 @@ (with-postgresql-connection "web healthcheck" (lambda (conn) - (number? - (string->number - (first - (count-guix-revisions conn))))))) + (number? (count-guix-revisions conn))))) (lambda (key . args) #f)))) (render-json |