guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[no subject]


From: Ludovic Courtès
Date: Thu, 28 Sep 2023 06:53:43 -0400 (EDT)

branch: master
commit 2d018ac62f20e210f1dfdacf2661d153e308f0ca
Author: Ludovic Courtès <ludo@gnu.org>
AuthorDate: Thu Sep 28 12:03:43 2023 +0200

    base: Really honor the period defined in a spec.
    
    Fixes a regression introduced in
    8fa6bcf1b93404f49ad819a6d9a714623ec93ee1.
    
    * src/cuirass/base.scm (jobset-registry): Honor SPEC’s period when it is
    non-zero, passing it to ‘spawn-jobset-monitor’.
---
 src/cuirass/base.scm | 20 +++++++++++---------
 1 file changed, 11 insertions(+), 9 deletions(-)

diff --git a/src/cuirass/base.scm b/src/cuirass/base.scm
index 70324aa..316e52e 100644
--- a/src/cuirass/base.scm
+++ b/src/cuirass/base.scm
@@ -803,8 +803,8 @@ POLLING-PERIOD seconds."
 ;;;
 
 (define* (jobset-registry channel
-                         #:key (polling-period 60)
-                         update-service evaluator)
+                          #:key (polling-period 60)
+                          update-service evaluator)
   (lambda ()
     (spawn-fiber
      (lambda ()
@@ -833,13 +833,15 @@ POLLING-PERIOD seconds."
         (`(register ,spec)
          (match (vhash-assq (specification-name spec) registry)
            (#f
-            (let ((monitor (spawn-jobset-monitor spec
-                                                 #:update-service
-                                                 update-service
-                                                 #:evaluator evaluator
-                                                 #:polling-period
-                                                 polling-period))
-                  (name (specification-name spec)))
+            (let* ((period (match (specification-period spec)
+                             (0 polling-period)
+                             (period period)))
+                   (monitor (spawn-jobset-monitor spec
+                                                  #:update-service
+                                                  update-service
+                                                  #:evaluator evaluator
+                                                  #:polling-period period))
+                   (name (specification-name spec)))
               (log-info "registering new jobset '~a'" name)
               (loop (vhash-consq (string->symbol name) monitor
                                  registry))))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]