Permalink
Browse files

packager: GlobalTransformCache: retry keys fetches

Reviewed By: davidaurelio

Differential Revision: D4779641

fbshipit-source-id: 1b156bf075fa2456d9e6b1a3f38855357abc1abb
  • Loading branch information...
jeanlauliac authored and facebook-github-bot committed Mar 28, 2017
1 parent 1d37dd0 commit 33000c74f9b0178f547506688f2a28dc47f6579e
Showing with 5 additions and 1 deletion.
  1. +5 −1 packager/src/lib/GlobalTransformCache.js
@@ -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);
}

0 comments on commit 33000c7

Please sign in to comment.