aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Baines <mail@cbaines.net>2023-08-29 11:35:33 +0100
committerChristopher Baines <mail@cbaines.net>2023-08-29 11:35:33 +0100
commit1f69f40db0d1d65cae5880847d120baf974fbbef (patch)
tree20f9c51caabdc5373008575e54213cf5c55b4c14
parent06a44693c4f25109f945e5aa6c7c4670df72b690 (diff)
downloadbuild-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.scm24
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