[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#63646: [PATCH] substitute: If a server's nar URL is 404, try the nex
From: |
Ludovic Courtès |
Subject: |
bug#63646: [PATCH] substitute: If a server's nar URL is 404, try the next one(s). |
Date: |
Tue, 30 May 2023 00:19:07 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) |
Hi,
Ludovic Courtès <ludo@gnu.org> skribis:
> Ludovic Courtès <ludo@gnu.org> skribis:
>
>> + (define (try-fetch choices)
>> + (match choices
>> + (((uri compression file-size) rest ...)
>> + (guard (c ((and (pair? rest) (network-error? c))
>> + (warning (G_ "download from '~a' failed, trying next
>> URL~%")
>> + (uri->string uri))
>
> I realized we can change ‘network-error?’ to ‘http-get-error?’ above.
> Otherwise, we could find ourselves trying several nar URLs on the same
> server when the error is ETIMEDOUT or ECONNREFUSED, which would be a
> waste of time.
Pushed as 8af9a2aa5fa2fa5b00234c1cbe12e9aff60888a0.
Ludo’.