Skip to content

Commit 33000c7

Browse files
Jean Lauliacfacebook-github-bot
Jean Lauliac
authored andcommitted
packager: GlobalTransformCache: retry keys fetches
Reviewed By: davidaurelio Differential Revision: D4779641 fbshipit-source-id: 1b156bf075fa2456d9e6b1a3f38855357abc1abb
1 parent 1d37dd0 commit 33000c7

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

packager/src/lib/GlobalTransformCache.js

+5-1
Original file line numberDiff line numberDiff line change
@@ -239,13 +239,17 @@ class GlobalTransformCache {
239239
*/
240240
static fetchResultFromURI(uri: string): Promise<CachedResult> {
241241
return GlobalTransformCache._fetchResultFromURI(uri).catch(error => {
242-
if (!(error instanceof FetchError && error.type === 'request-timeout')) {
242+
if (!GlobalTransformCache.isTimeoutError(error)) {
243243
throw error;
244244
}
245245
return this._fetchResultFromURI(uri);
246246
});
247247
}
248248
249+
static isTimeoutError(error: Error): boolean {
250+
return error instanceof FetchError && error.type === 'request-timeout';
251+
}
252+
249253
shouldFetch(props: FetchProps): boolean {
250254
return this._profileSet.has(props.transformOptions);
251255
}

0 commit comments

Comments
 (0)