diff options
Diffstat (limited to 'guix-build-coordinator')
-rw-r--r-- | guix-build-coordinator/agent-messaging/http.scm | 61 |
1 files changed, 20 insertions, 41 deletions
diff --git a/guix-build-coordinator/agent-messaging/http.scm b/guix-build-coordinator/agent-messaging/http.scm index 7d61ab4..a47c60d 100644 --- a/guix-build-coordinator/agent-messaging/http.scm +++ b/guix-build-coordinator/agent-messaging/http.scm @@ -81,12 +81,6 @@ if there was no request body." (define hook-channel (make-hook-channel datastore hooks)) - (define chunked-request-channel - ;; I can't work out how to stop the blocking when reading the chunked - ;; request bodies, so just do it in a different thread. - (make-worker-thread-channel (const '()) - #:parallelism 4)) - (trigger-build-allocation) (call-with-error-handling (lambda () @@ -105,8 +99,7 @@ if there was no request body." secret-key-base datastore trigger-build-allocation - hook-channel - chunked-request-channel))) + hook-channel))) 'fibers (list #:host host #:port port))) @@ -154,8 +147,7 @@ port. Also, the port used can be changed by passing the --port option.\n" secret-key-base datastore trigger-build-allocation - hook-channel - chunked-request-channel) + hook-channel) (define (authenticated? uuid request) (let* ((authorization-base64 (match (assq-ref (request-headers request) @@ -256,21 +248,15 @@ port. Also, the port used can be changed by passing the --port option.\n" (let ((output-file-name (build-log-file-location datastore uuid format))) (mkdir-p (dirname output-file-name)) - (if (call-with-worker-thread - chunked-request-channel - (lambda () - (call-with-output-file output-file-name - (lambda (output-port) - (let loop ((line (get-line body))) - (unless (eof-object? line) - (base64-decode line - base64-alphabet - output-port) - (loop (get-line body)))))))) - (no-content) - (render-json - "error" - #:code 500))) + (call-with-output-file output-file-name + (lambda (output-port) + (let loop ((line (get-line body))) + (unless (eof-object? line) + (base64-decode line + base64-alphabet + output-port) + (loop (get-line body)))))) + (no-content)) (render-json "access denied" #:code 403)))) @@ -281,22 +267,15 @@ port. Also, the port used can be changed by passing the --port option.\n" (let ((output-file-name (build-output-file-location datastore uuid output-name))) (mkdir-p (dirname output-file-name)) - (if (call-with-worker-thread - chunked-request-channel - (lambda () - (call-with-output-file output-file-name - (lambda (output-port) - (let loop ((line (get-line body))) - (unless (eof-object? line) - (base64-decode line - base64-alphabet - output-port) - (loop (get-line body)))))) - #t)) - (no-content) - (render-json - "error" - #:code 500))) + (call-with-output-file output-file-name + (lambda (output-port) + (let loop ((line (get-line body))) + (unless (eof-object? line) + (base64-decode line + base64-alphabet + output-port) + (loop (get-line body)))))) + (no-content)) (render-json "access denied" #:code 403)))) |