diff options
author | Christopher Baines <mail@cbaines.net> | 2024-04-22 09:44:32 +0100 |
---|---|---|
committer | Christopher Baines <mail@cbaines.net> | 2024-04-22 09:44:32 +0100 |
commit | b1e273c94b05aeb5cfee1a95055b26d1170ce01e (patch) | |
tree | 29d72d9e64f417f3fdb6af296463ec06960c650b | |
parent | d75181ebeba1caa8663e09b9dbe504912b199edf (diff) | |
download | build-coordinator-b1e273c94b05aeb5cfee1a95055b26d1170ce01e.tar build-coordinator-b1e273c94b05aeb5cfee1a95055b26d1170ce01e.tar.gz |
Tweak running sqitch
-rw-r--r-- | guix-build-coordinator/datastore/sqlite.scm | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/guix-build-coordinator/datastore/sqlite.scm b/guix-build-coordinator/datastore/sqlite.scm index 5e39849..e67a940 100644 --- a/guix-build-coordinator/datastore/sqlite.scm +++ b/guix-build-coordinator/datastore/sqlite.scm @@ -123,7 +123,11 @@ (string-length "sqlite://"))) (when update-database? - (run-sqitch database-file)) + (retry-on-error + (lambda () + (run-sqitch database-file)) + #:times 2 + #:delay 5)) (let ((db (db-open database-file))) (sqlite-exec db "PRAGMA journal_mode=WAL;") @@ -3704,11 +3708,12 @@ WHERE build_results.build_id = :build_id" (simple-format #t "running command: ~A\n" (string-join command)) - (unless (zero? (apply system* command)) - (simple-format - (current-error-port) - "error: sqitch command failed\n") - (exit 1)))) + (let ((pid (spawn (%config 'sqitch) command))) + (unless (zero? (cdr (waitpid pid))) + (simple-format + (current-error-port) + "error: sqitch command failed\n") + (exit 1))))) (define (changes-count db) (let ((statement |