aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Baines <mail@cbaines.net>2020-09-20 18:38:39 +0100
committerChristopher Baines <mail@cbaines.net>2020-09-20 18:38:39 +0100
commit857ac36711d84ab3dab5b73fc5f25f158a1af3b9 (patch)
tree8093f89959ebd84348e681b44073faab16fe2d53
parente38db9eed95de0f286e666b630d082ddb9e263ce (diff)
downloaddata-service-857ac36711d84ab3dab5b73fc5f25f158a1af3b9.tar
data-service-857ac36711d84ab3dab5b73fc5f25f158a1af3b9.tar.gz
Return a number from count-guix-revisions
-rw-r--r--guix-data-service/model/guix-revision.scm8
-rw-r--r--guix-data-service/web/controller.scm5
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