cuirass: Clear the build queue when starting.
* src/cuirass/base.scm (clear-build-queue): New procedure. * bin/cuirass.in (main): Call it.
This commit is contained in:
parent
bc723b0835
commit
8080c17c21
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue