Tweak timeouts in resource-pool-stats

This commit is contained in:
Christopher Baines 2024-07-29 11:24:08 +01:00
parent fbbdc41f5c
commit f0f1329461

View file

@ -453,7 +453,9 @@ available. Return the resource once PROC has returned."
(put-operation pool `(stats ,reply)) (put-operation pool `(stats ,reply))
(const #t)) (const #t))
(wrap-operation (sleep-operation timeout) (wrap-operation (sleep-operation timeout)
(const #f)))) (lambda _
(raise-exception
(make-resource-pool-timeout-error))))))
(let ((time-remaining (let ((time-remaining
(- timeout (- timeout
@ -461,13 +463,13 @@ available. Return the resource once PROC has returned."
start-time) start-time)
internal-time-units-per-second)))) internal-time-units-per-second))))
(if (> time-remaining 0) (if (> time-remaining 0)
(let ((response (perform-operation
(perform-operation (choice-operation
(choice-operation (get-operation reply)
(get-operation reply) (wrap-operation (sleep-operation time-remaining)
(wrap-operation (sleep-operation time-remaining) (lambda _
(const #f)))))) (raise-exception
response) (make-resource-pool-timeout-error))))))
(raise-exception (raise-exception
(make-resource-pool-timeout-error)))))) (make-resource-pool-timeout-error))))))