aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Baines <mail@cbaines.net>2020-11-13 21:19:53 +0000
committerChristopher Baines <mail@cbaines.net>2020-11-13 21:19:53 +0000
commit4f225a13bd8be43b6e4b41338d01410f3076b51f (patch)
tree89e8d4fbb9e12b6e0b6cb6e17311b4693a8b6f22
parent049334e423241426c0eef526eda8818e96f5b3ca (diff)
downloadbuild-coordinator-4f225a13bd8be43b6e4b41338d01410f3076b51f.tar
build-coordinator-4f225a13bd8be43b6e4b41338d01410f3076b51f.tar.gz
Cache a couple of SQLite statements that should be cached
-rw-r--r--guix-build-coordinator/datastore/sqlite.scm20
1 files changed, 8 insertions, 12 deletions
diff --git a/guix-build-coordinator/datastore/sqlite.scm b/guix-build-coordinator/datastore/sqlite.scm
index 8a76e50..82d7003 100644
--- a/guix-build-coordinator/datastore/sqlite.scm
+++ b/guix-build-coordinator/datastore/sqlite.scm
@@ -1185,18 +1185,13 @@ EXCEPT
(let ((statement
(sqlite-prepare
db
- (string-append
- "
-SELECT * FROM unprocessed_builds"))))
-
- (let ((builds (sqlite-map
- (match-lambda
- (#(uuid) uuid))
- statement)))
-
- (sqlite-finalize statement)
+ "SELECT * FROM unprocessed_builds"
+ #:cache? #t)))
- builds)))
+ (sqlite-map
+ (match-lambda
+ (#(uuid) uuid))
+ statement)))
(define (fetch-propagated-priorities-for-unprocessed-builds db)
(let ((statement
@@ -1264,7 +1259,8 @@ GROUP BY builds_with_derived_priority.uuid"
db
"
INSERT INTO unprocessed_hook_events (event, arguments)
-VALUES (:event, :arguments)")))
+VALUES (:event, :arguments)"
+ #:cache? #t)))
(sqlite-bind-arguments statement
#:event event