branch: main
commit d31dc1718fa557fcbbd243ce4b44705e803fae4e
Author: Ludovic Courtès <[email protected]>
AuthorDate: Sun Jan 5 19:27:06 2025 +0100

    base: Really run ‘build-queue-cleaner’ in a separate fiber.
    
    Fixes a bug introduced in 3665686d1e1997d189059e7583e77464a7dd1e20,
    whereby ‘build-queue-cleaner’ would never return, thus preventing the
    metrics and log-monitoring fibers from ever being spawned (in
    ‘cuirass-register’).
    
    * src/cuirass/base.scm (build-queue-cleaner): Wrap in a thunk.
---
 src/cuirass/base.scm | 15 ++++++++-------
 1 file changed, 8 insertions(+), 7 deletions(-)

diff --git a/src/cuirass/base.scm b/src/cuirass/base.scm
index 837de51..3bc9796 100644
--- a/src/cuirass/base.scm
+++ b/src/cuirass/base.scm
@@ -1,5 +1,5 @@
 ;;; base.scm -- Cuirass base module
-;;; Copyright © 2016-2019, 2022-2024 Ludovic Courtès <[email protected]>
+;;; Copyright © 2016-2019, 2022-2025 Ludovic Courtès <[email protected]>
 ;;; Copyright © 2016, 2017 Mathieu Lirzin <[email protected]>
 ;;; Copyright © 2017, 2020, 2021 Mathieu Othacehe <[email protected]>
 ;;; Copyright © 2017 Ricardo Wurmus <[email protected]>
@@ -1070,12 +1070,13 @@ one of the following symbols denoting the specific 
maintenance task requested:
     channel))
 
 (define (build-queue-cleaner period expiry)
-  (log-info "pending builds older than ~as will be canceled every ~as"
-            expiry period)
-  (let loop ()
-    (db-cancel-old-pending-builds expiry)
-    (sleep period)
-    (loop)))
+  (lambda ()
+    (log-info "pending builds older than ~as will be canceled every ~as"
+              expiry period)
+    (let loop ()
+      (db-cancel-old-pending-builds expiry)
+      (sleep period)
+      (loop))))
 
 (define* (spawn-build-queue-cleaner expiry #:optional (period (* 24 3600)))
   "Spawn an agent that periodically cancels pending builds that are more than

Reply via email to