aboutsummaryrefslogtreecommitdiff
path: root/guix-build-coordinator/utils
diff options
context:
space:
mode:
Diffstat (limited to 'guix-build-coordinator/utils')
-rw-r--r--guix-build-coordinator/utils/fibers.scm11
1 files changed, 9 insertions, 2 deletions
diff --git a/guix-build-coordinator/utils/fibers.scm b/guix-build-coordinator/utils/fibers.scm
index 99ca27f..921da8d 100644
--- a/guix-build-coordinator/utils/fibers.scm
+++ b/guix-build-coordinator/utils/fibers.scm
@@ -20,6 +20,7 @@
(define* (make-worker-thread-channel initializer
#:key (parallelism 1)
(delay-logger (lambda _ #f))
+ (duration-logger (const #f))
destructor
lifetime
(log-exception? (const #t))
@@ -77,8 +78,14 @@ arguments of the worker thread procedure."
response)
(match response
- (('worker-thread-error rest ...) #t)
- (_ #f))))))))
+ (('worker-thread-error duration _)
+ (when duration-logger
+ (duration-logger duration proc))
+ #t)
+ ((duration . _)
+ (when duration-logger
+ (duration-logger duration proc))
+ #f))))))))
(unless (and expire-on-exception?
exception?)
(if (number? current-lifetime)