Stream the package derivation page since it can be large
This commit is contained in:
parent
bbbcea8ff6
commit
5f8cd2dc56
2 changed files with 13 additions and 6 deletions
|
|
@ -748,7 +748,8 @@
|
||||||
(valid-targets->options targets)
|
(valid-targets->options targets)
|
||||||
build-status-strings
|
build-status-strings
|
||||||
build-server-urls
|
build-server-urls
|
||||||
derivation-changes))))))))))))
|
derivation-changes)
|
||||||
|
#:stream? #t)))))))))))
|
||||||
|
|
||||||
(define (render-compare-by-datetime/package-derivations mime-types
|
(define (render-compare-by-datetime/package-derivations mime-types
|
||||||
query-parameters)
|
query-parameters)
|
||||||
|
|
|
||||||
|
|
@ -139,17 +139,23 @@
|
||||||
#f)))
|
#f)))
|
||||||
|
|
||||||
(define* (render-html #:key sxml (extra-headers '())
|
(define* (render-html #:key sxml (extra-headers '())
|
||||||
(code 200))
|
(code 200)
|
||||||
|
stream?)
|
||||||
(list (build-response
|
(list (build-response
|
||||||
#:code code
|
#:code code
|
||||||
#:headers (append extra-headers
|
#:headers (append extra-headers
|
||||||
'((content-type . (text/html
|
'((content-type . (text/html
|
||||||
(charset . "utf-8")))
|
(charset . "utf-8")))
|
||||||
(vary . (accept)))))
|
(vary . (accept)))))
|
||||||
|
(if stream?
|
||||||
|
(lambda (port)
|
||||||
|
(set-port-encoding! port "utf-8")
|
||||||
|
(setvbuf port 'block (expt 2 20))
|
||||||
|
(sxml->html sxml port))
|
||||||
(call-with-encoded-output-string
|
(call-with-encoded-output-string
|
||||||
"utf-8"
|
"utf-8"
|
||||||
(lambda (port)
|
(lambda (port)
|
||||||
(sxml->html sxml port)))))
|
(sxml->html sxml port))))))
|
||||||
|
|
||||||
(define* (render-json json #:key (extra-headers '())
|
(define* (render-json json #:key (extra-headers '())
|
||||||
(code 200)
|
(code 200)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue