diff options
author | Christopher Baines <mail@cbaines.net> | 2024-06-08 22:38:43 +0100 |
---|---|---|
committer | Christopher Baines <mail@cbaines.net> | 2024-06-08 22:38:43 +0100 |
commit | 7d4b32029b84628210d6e7f14dff06f288318ed2 (patch) | |
tree | 44eae035ea442bc7e8323f802a655d5b37e03c60 /guix-qa-frontpage/patchwork.scm | |
parent | ad0a5efea4ac70ca02f68ddbaa82740b074dc0f4 (diff) | |
download | qa-frontpage-7d4b32029b84628210d6e7f14dff06f288318ed2.tar qa-frontpage-7d4b32029b84628210d6e7f14dff06f288318ed2.tar.gz |
Tweak fetching patchwork data
Diffstat (limited to 'guix-qa-frontpage/patchwork.scm')
-rw-r--r-- | guix-qa-frontpage/patchwork.scm | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/guix-qa-frontpage/patchwork.scm b/guix-qa-frontpage/patchwork.scm index 855e6a7..08bf62f 100644 --- a/guix-qa-frontpage/patchwork.scm +++ b/guix-qa-frontpage/patchwork.scm @@ -16,6 +16,7 @@ #:use-module ((guix-build-coordinator utils fibers) #:select (retry-on-error)) #:use-module (guix-qa-frontpage mumi) + #:use-module (guix-qa-frontpage utils) #:use-module (guix-qa-frontpage debbugs) #:export (%patchwork-instance @@ -79,12 +80,16 @@ (retry-on-error (lambda () (http-request uri - #:decode-body? #f)) + #:port (open-socket-for-uri* uri) + #:decode-body? #f + #:streaming? #t)) #:times 2 #:delay 3))) (values - (json-string->scm (utf8->string body)) + (let ((json (json->scm body))) + (close-port body) + json) (and=> (assq-ref (response-headers response) 'link) (lambda (link-header) (and=> @@ -245,7 +250,10 @@ ;; Need more series, so keep going (let* ((series-batch next-page-uri - (request-patchwork-series patchwork-uri)) + (with-fibers-port-timeouts + (lambda () + (request-patchwork-series patchwork-uri)) + #:timeout 60)) (batch-hash-table (make-hash-table))) |