mirror of
https://github.com/arcodange-org/mediabunny.git
synced 2026-09-27 10:53:50 +02:00
getRetryDelay() takes src as well
This commit is contained in:
+2
-2
@@ -578,7 +578,7 @@ export const retriedFetch = async (
|
||||
fetchFn: typeof fetch,
|
||||
url: string | URL | Request,
|
||||
requestInit: RequestInit,
|
||||
getRetryDelay: (previousAttempts: number, error: unknown) => number | null,
|
||||
getRetryDelay: (previousAttempts: number, error: unknown, url: string | URL | Request) => number | null,
|
||||
) => {
|
||||
let attempts = 0;
|
||||
|
||||
@@ -587,7 +587,7 @@ export const retriedFetch = async (
|
||||
return await fetchFn(url, requestInit);
|
||||
} catch (error) {
|
||||
attempts++;
|
||||
const retryDelayInSeconds = getRetryDelay(attempts, error);
|
||||
const retryDelayInSeconds = getRetryDelay(attempts, error, url);
|
||||
|
||||
if (retryDelayInSeconds === null) {
|
||||
throw error;
|
||||
|
||||
Reference in New Issue
Block a user