cbaines pushed a commit to branch master
in repository data-service.
commit f0f13294610846e8d924fa24b1e96730ffd74f1d
Author: Christopher Baines <[email protected]>
AuthorDate: Mon Jul 29 11:24:08 2024 +0100
Tweak timeouts in resource-pool-stats
---
guix-data-service/utils.scm | 18 ++++++++++--------
1 file changed, 10 insertions(+), 8 deletions(-)
diff --git a/guix-data-service/utils.scm b/guix-data-service/utils.scm
index e5b4a45..13dce82 100644
--- a/guix-data-service/utils.scm
+++ b/guix-data-service/utils.scm
@@ -453,7 +453,9 @@ available. Return the resource once PROC has returned."
(put-operation pool `(stats ,reply))
(const #t))
(wrap-operation (sleep-operation timeout)
- (const #f))))
+ (lambda _
+ (raise-exception
+ (make-resource-pool-timeout-error))))))
(let ((time-remaining
(- timeout
@@ -461,13 +463,13 @@ available. Return the resource once PROC has returned."
start-time)
internal-time-units-per-second))))
(if (> time-remaining 0)
- (let ((response
- (perform-operation
- (choice-operation
- (get-operation reply)
- (wrap-operation (sleep-operation time-remaining)
- (const #f))))))
- response)
+ (perform-operation
+ (choice-operation
+ (get-operation reply)
+ (wrap-operation (sleep-operation time-remaining)
+ (lambda _
+ (raise-exception
+ (make-resource-pool-timeout-error))))))
(raise-exception
(make-resource-pool-timeout-error))))))