diff options
author | Christopher Baines <mail@cbaines.net> | 2020-04-13 20:50:12 +0100 |
---|---|---|
committer | Christopher Baines <mail@cbaines.net> | 2020-04-13 20:50:12 +0100 |
commit | e79112458f7a4882c470e91b75fc2f934b64a668 (patch) | |
tree | c3642a3d213394b3ed24a9280bf55e1863d123c3 | |
parent | d362c69c15dc75f94d9509a2c7c498ec0ee5cfc4 (diff) | |
download | build-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.scm | 3 |
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) |