From dd30a1a25cd419614656a70b98adbe26e181458f Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Tue, 23 Jan 2018 23:15:10 +0100 Subject: 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. --- bin/cuirass.in | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'bin') 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 -- cgit v1.2.3