diff options
author | Christopher Baines <mail@cbaines.net> | 2023-08-29 11:35:33 +0100 |
---|---|---|
committer | Christopher Baines <mail@cbaines.net> | 2023-08-29 11:35:33 +0100 |
commit | 1f69f40db0d1d65cae5880847d120baf974fbbef (patch) | |
tree | 20f9c51caabdc5373008575e54213cf5c55b4c14 | |
parent | 06a44693c4f25109f945e5aa6c7c4670df72b690 (diff) | |
download | build-coordinator-1f69f40db0d1d65cae5880847d120baf974fbbef.tar build-coordinator-1f69f40db0d1d65cae5880847d120baf974fbbef.tar.gz |
Stop closing the ports for json seq responses
As this breaks reading the stream.
-rw-r--r-- | guix-build-coordinator/client-communication.scm | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/guix-build-coordinator/client-communication.scm b/guix-build-coordinator/client-communication.scm index 3f59dad..61b8731 100644 --- a/guix-build-coordinator/client-communication.scm +++ b/guix-build-coordinator/client-communication.scm @@ -703,17 +703,19 @@ (set-port-encoding! body "UTF-8") (values - (let ((parsed-body - (if (equal? '(application/json-seq) - (response-content-type response)) - (json-seq->scm - body - ;; TODO I would like to use 'throw, but it always raises an - ;; exception, so this needs fixing upstream first - #:handle-truncate 'replace) - (json->scm body)))) - (close-port body) - parsed-body) + (if (equal? '(application/json-seq) + (response-content-type response)) + ;; TODO There's no mechanism to close the port after the + ;; stream/sequence has finished + (json-seq->scm + body + ;; TODO I would like to use 'throw, but it always raises an + ;; exception, so this needs fixing upstream first + #:handle-truncate 'replace) + (let ((parsed-body + (json->scm body))) + (close-port body) + parsed-body)) response)))))) (define* (send-submit-build-request |