Skip to content

Commit 3a80d36

Browse files
committed
removed retry
1 parent 62e2d96 commit 3a80d36

File tree

1 file changed

+4
-12
lines changed

1 file changed

+4
-12
lines changed

src/Lighthouse/utils/util.ts

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ function checkDuplicateFileNames(files: any[]) {
3939
}
4040

4141
async function fetchWithTimeout(
42-
resource: string,
42+
endpointURL: string,
4343
options: FetchOptions
4444
): Promise<Response> {
4545
const { timeout = 8000, onProgress, ...rest } = options
@@ -51,7 +51,7 @@ async function fetchWithTimeout(
5151
if (onProgress && rest.body instanceof FormData) {
5252
return new Promise<Response>((resolve, reject) => {
5353
const xhr = new XMLHttpRequest()
54-
xhr.open(rest.method || 'GET', resource)
54+
xhr.open(rest.method || 'GET', endpointURL)
5555

5656
if (rest.headers) {
5757
if (rest.headers instanceof Headers) {
@@ -114,7 +114,7 @@ async function fetchWithTimeout(
114114
}
115115
})
116116
} else {
117-
const response = await fetch(resource, {
117+
const response = await fetch(endpointURL, {
118118
...rest,
119119
signal: controller.signal,
120120
})
@@ -127,18 +127,10 @@ async function fetchWithTimeout(
127127
}
128128
}
129129

130-
async function retryFetch(
131-
resource: string,
132-
options: FetchOptions,
133-
retries = 3
134-
): Promise<Response> {
135-
return await fetchWithTimeout(resource, options)
136-
}
137-
138130
export {
139131
isCID,
140132
isPrivateKey,
141133
addressValidator,
142134
checkDuplicateFileNames,
143-
retryFetch,
135+
fetchWithTimeout,
144136
}

0 commit comments

Comments
 (0)