From b3f52190624c26e652058c1956270e8c32e94db9 Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Fri, 26 Dec 2025 14:24:10 -0600 Subject: [PATCH] Fetching from each clone URL sequentially is actually faster and more efficient --- src/lib/git.ts | 28 ++++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/src/lib/git.ts b/src/lib/git.ts index 4a26f822..81c44107 100644 --- a/src/lib/git.ts +++ b/src/lib/git.ts @@ -802,18 +802,22 @@ export class Git { } // Fetch from each clone URL - await Promise.allSettled(cloneUrls.map((url) => { - return Promise.race([ - new Promise((_, reject) => setTimeout(() => reject(new Error('Fetch from Nostr clone URL timed out')), 10_000)), - git.fetch({ - ...options, - fs: this.fs, - http: this.httpNoProxy, - url, - remote, - }), - ]) - })); + for (const url of cloneUrls) { + try { + await Promise.race([ + new Promise((_, reject) => setTimeout(() => reject(new Error('Fetch from Nostr clone URL timed out')), 10_000)), + git.fetch({ + ...options, + fs: this.fs, + http: this.httpNoProxy, + url, + remote, + }), + ]); + } catch { + // Ignore fetch errors from individual clone URLs + } + } const result: FetchResult = { defaultBranch: null,