diff options
author | Ludovic Courtès <ludo@gnu.org> | 2018-01-23 23:15:10 +0100 |
---|---|---|
committer | Ludovic Courtès <ludo@gnu.org> | 2018-01-23 23:40:07 +0100 |
commit | dd30a1a25cd419614656a70b98adbe26e181458f (patch) | |
tree | a4ac39784c9a5ead96c5c8287695a67cad33a83c /bin | |
parent | 06b8af00fbf6c0d146411e895da1bc95365d364b (diff) | |
download | cuirass-dd30a1a25cd419614656a70b98adbe26e181458f.tar cuirass-dd30a1a25cd419614656a70b98adbe26e181458f.tar.gz |
base: Restart pending builds upfront.
* src/cuirass/database.scm (db-get-builds)[format-where-clause]:
Honor (status pending) filter.
* src/cuirass/base.scm (restart-builds): New procedure.
* bin/cuirass.in (main): Fetch pending builds. Start fiber that invokes
'restart-builds' on them.
Diffstat (limited to 'bin')
-rw-r--r-- | bin/cuirass.in | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/bin/cuirass.in b/bin/cuirass.in index 4553567..56db386 100644 --- a/bin/cuirass.in +++ b/bin/cuirass.in @@ -107,7 +107,15 @@ exec ${GUILE:-@GUILE@} --no-auto-compile -e main -s "$0" "$@" new-specs))) (if one-shot? (process-specs db (db-get-specifications db)) - (begin + (let ((pending (db-get-builds db '((status pending))))) + ;; First off, restart builds that had not completed or + ;; were not even started on a previous run. + (spawn-fiber + (lambda () + (with-store store + (with-database db + (restart-builds store db pending))))) + (spawn-fiber (lambda () (with-database db @@ -115,6 +123,7 @@ exec ${GUILE:-@GUILE@} --no-auto-compile -e main -s "$0" "$@" (process-specs db (db-get-specifications db)) (log-message "sleeping for ~a seconds" interval) (sleep interval))))) + (with-database db (run-cuirass-server db #:host host |