aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Baines <mail@cbaines.net>2020-04-13 20:50:12 +0100
committerChristopher Baines <mail@cbaines.net>2020-04-13 20:50:12 +0100
commite79112458f7a4882c470e91b75fc2f934b64a668 (patch)
treec3642a3d213394b3ed24a9280bf55e1863d123c3
parentd362c69c15dc75f94d9509a2c7c498ec0ee5cfc4 (diff)
downloadbuild-coordinator-e79112458f7a4882c470e91b75fc2f934b64a668.tar
build-coordinator-e79112458f7a4882c470e91b75fc2f934b64a668.tar.gz
Support emptying the build plan
Previously, it would error trying to insert 0 records.
-rw-r--r--guix-build-coordinator/datastore/sqlite.scm3
1 files changed, 2 insertions, 1 deletions
diff --git a/guix-build-coordinator/datastore/sqlite.scm b/guix-build-coordinator/datastore/sqlite.scm
index 4d8a3e8..08f70e9 100644
--- a/guix-build-coordinator/datastore/sqlite.scm
+++ b/guix-build-coordinator/datastore/sqlite.scm
@@ -422,7 +422,8 @@ INSERT INTO build_allocation_plan (build_id, agent_id, ordering) VALUES "
(lambda (db)
(sqlite-exec db "BEGIN TRANSACTION;")
(clear-current-plan db)
- (insert-new-plan db planned-builds)
+ (unless (null? planned-builds)
+ (insert-new-plan db planned-builds))
(sqlite-exec db "COMMIT TRANSACTION;")))
#t)