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))
(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))))))