Skip to content
Snippets Groups Projects
Commit 8080c17c authored by Ludovic Courtès's avatar Ludovic Courtès
Browse files

cuirass: Clear the build queue when starting.

* src/cuirass/base.scm (clear-build-queue): New procedure.
* bin/cuirass.in (main): Call it.
parent bc723b08
No related branches found
No related tags found
No related merge requests found
......@@ -126,6 +126,7 @@ exec ${GUILE:-@GUILE@} --no-auto-compile -e main -s "$0" "$@"
(let ((exit-channel (make-channel))
(pending
(begin
(clear-build-queue db)
(log-message "retrieving list of pending builds...")
(db-get-builds db '((status pending))))))
......
......@@ -49,6 +49,7 @@
fetch-repository
compile
evaluate
clear-build-queue
restart-builds
build-packages
prepare-git
......@@ -452,6 +453,12 @@ updating DB accordingly."
(string=? (assq-ref build1 #:derivation)
(assq-ref build2 #:derivation)))
(define (clear-build-queue db)
"Reset the status of builds in DB that are marked as \"started\". This
procedure is meant to be called at startup."
(log-message "marking stale builds as \"scheduled\"...")
(sqlite-exec db "UPDATE Builds SET status = -2 WHERE status = -1;"))
(define (restart-builds db builds)
"Restart builds whose status in DB is \"pending\" (scheduled or started)."
(with-store store
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment