Skip to content

Commit e615a31

Browse files
authored
eng - increase remote download retries (microsoft#184431)
1 parent 1feafba commit e615a31

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

build/lib/gulpRemoteSource.js

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

build/lib/gulpRemoteSource.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,11 @@ export function remote(urls: string[] | string, options: IOptions): es.ThroughSt
4444
}));
4545
}
4646

47-
async function fetchWithRetry(url: string, options: IOptions, retries = 3, retryDelay = 250): Promise<VinylFile> {
47+
async function fetchWithRetry(url: string, options: IOptions, retries = 10, retryDelay = 250): Promise<VinylFile> {
4848
try {
4949
let startTime = 0;
5050
if (options.verbose) {
51-
log(`Start fetching ${ansiColors.magenta(url)}${retries !== 3 ? `(${3 - retries} retry}` : ''}`);
51+
log(`Start fetching ${ansiColors.magenta(url)}${retries !== 10 ? `(${10 - retries} retry}` : ''}`);
5252
startTime = new Date().getTime();
5353
}
5454
const response = await fetch(url, options.fetchOptions);
@@ -69,7 +69,7 @@ async function fetchWithRetry(url: string, options: IOptions, retries = 3, retry
6969
} catch (e) {
7070
if (retries > 0) {
7171
await new Promise(c => setTimeout(c, retryDelay));
72-
return fetchWithRetry(url, options, retries - 1, retryDelay * 3);
72+
return fetchWithRetry(url, options, retries - 1, retryDelay * 2);
7373
}
7474
if (options.verbose) {
7575
log(`Fetching ${ansiColors.cyan(url)} failed: ${e}`);

0 commit comments

Comments
 (0)