mirror of https://github.com/status-im/metro.git
packager: GlobalTransformCache: retry keys fetches
Reviewed By: davidaurelio Differential Revision: D4779641 fbshipit-source-id: 1b156bf075fa2456d9e6b1a3f38855357abc1abb
This commit is contained in:
parent
f2340c746b
commit
6b89f0ac28
|
@ -239,13 +239,17 @@ class GlobalTransformCache {
|
|||
*/
|
||||
static fetchResultFromURI(uri: string): Promise<CachedResult> {
|
||||
return GlobalTransformCache._fetchResultFromURI(uri).catch(error => {
|
||||
if (!(error instanceof FetchError && error.type === 'request-timeout')) {
|
||||
if (!GlobalTransformCache.isTimeoutError(error)) {
|
||||
throw error;
|
||||
}
|
||||
return this._fetchResultFromURI(uri);
|
||||
});
|
||||
}
|
||||
|
||||
static isTimeoutError(error: Error): boolean {
|
||||
return error instanceof FetchError && error.type === 'request-timeout';
|
||||
}
|
||||
|
||||
shouldFetch(props: FetchProps): boolean {
|
||||
return this._profileSet.has(props.transformOptions);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue