aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Baines <mail@cbaines.net>2020-01-05 11:17:56 +0000
committerChristopher Baines <mail@cbaines.net>2020-01-05 12:01:06 +0000
commite070c200300f65fbdd55e141e2d18bbc4093a628 (patch)
tree733e0031146970d3e48b422957229795ee84e05c
parentffcf937c6abc0aef0276b929a77219c19991b40c (diff)
downloaddata-service-e070c200300f65fbdd55e141e2d18bbc4093a628.tar
data-service-e070c200300f65fbdd55e141e2d18bbc4093a628.tar.gz
Make valid-systems quicker
In the future, it would be good to pull this from the database again, but in some way which is really quick.
-rw-r--r--guix-data-service/model/derivation.scm10
-rw-r--r--tests/model-derivation.scm2
2 files changed, 7 insertions, 5 deletions
diff --git a/guix-data-service/model/derivation.scm b/guix-data-service/model/derivation.scm
index cd850ae..033168b 100644
--- a/guix-data-service/model/derivation.scm
+++ b/guix-data-service/model/derivation.scm
@@ -59,10 +59,12 @@
derivation-file-names->derivation-ids))
(define (valid-systems conn)
- (map car
- (exec-query
- conn
- "SELECT DISTINCT system FROM derivations ORDER BY 1")))
+ ;; TODO, use the database, but make it quick!
+ '("aarch64-linux"
+ "armhf-linux"
+ "i686-linux"
+ "mips64el-linux"
+ "x86_64-linux"))
(define (count-derivations conn)
(first
diff --git a/tests/model-derivation.scm b/tests/model-derivation.scm
index eca3768..e02ff50 100644
--- a/tests/model-derivation.scm
+++ b/tests/model-derivation.scm
@@ -9,7 +9,7 @@
"test-model-derivation"
(lambda (conn)
(test-equal "valid-systems"
- '()
+ '("aarch64-linux" "armhf-linux" "i686-linux" "mips64el-linux" "x86_64-linux")
(valid-systems conn))
(test-equal "count-derivations"