Add an example slow endpoint to help with testing

How other things handle slow responses.
This commit is contained in:
Christopher Baines 2025-07-17 09:55:19 +01:00
parent eec7715928
commit b781d0e86d

View file

@ -874,6 +874,21 @@
(('GET "compare-by-datetime" _ ...) (delegate-to compare-controller))
(('GET "jobs" _ ...) (delegate-to jobs-controller))
(('GET "job" job-id) (delegate-to jobs-controller))
;; Example slow endpoint to help with testing
(('GET "slow")
(list (build-response
#:code 200
#:headers '((content-type . (text/plain
(charset . "utf-8")))
(vary . (accept))))
(lambda (port)
(force-output port)
(for-each
(lambda (i)
(put-string port (simple-format #f "slow ~A\n" i))
(force-output port)
(sleep 5))
(iota 12)))))
(('GET _ ...) (delegate-to nar-controller))
((method path ...)
(render-html