diff options
-rw-r--r-- | guix-data-service/builds.scm | 4 | ||||
-rw-r--r-- | guix-data-service/model/build-server.scm | 18 |
2 files changed, 16 insertions, 6 deletions
diff --git a/guix-data-service/builds.scm b/guix-data-service/builds.scm index 754ef89..8a92586 100644 --- a/guix-data-service/builds.scm +++ b/guix-data-service/builds.scm @@ -18,7 +18,7 @@ (for-each (match-lambda ((id url lookup-all-derivations?) - (when (string=? lookup-all-derivations? "t") + (when lookup-all-derivations? (query-build-server conn id url)))) build-servers)))) @@ -166,7 +166,7 @@ ") " "LIMIT 1000")) - (exec-query conn query (list build-server-id))) + (exec-query conn query (list (number->string build-server-id)))) (define (select-derivations-with-no-known-build conn) (define query diff --git a/guix-data-service/model/build-server.scm b/guix-data-service/model/build-server.scm index d75f6c8..3f31626 100644 --- a/guix-data-service/model/build-server.scm +++ b/guix-data-service/model/build-server.scm @@ -1,9 +1,19 @@ (define-module (guix-data-service model build-server) + #:use-module (ice-9 match) #:use-module (squee) #:export (select-build-servers)) (define (select-build-servers conn) - (exec-query conn - (string-append - "SELECT id, url, lookup_all_derivations " - "FROM build_servers"))) + (define query + " +SELECT id, url, lookup_all_derivations +FROM build_servers +ORDER BY id") + + (map + (match-lambda + ((id url lookup-all-derivations) + (list (string->number id) + url + (string=? lookup-all-derivations "t")))) + (exec-query conn query))) |