Retry icon download
Summary: In public CI (only?), asset downloads sometimes fail with a spurious 404. We already have retrying in place, but it will obviously not do that on a 500. Reviewed By: nikoant Differential Revision: D28744817 fbshipit-source-id: b6a185d8e9db45e02c6427233a0171b00c552751
This commit is contained in:
committed by
Facebook GitHub Bot
parent
9bfcadc2ef
commit
6d1cecdeee
@@ -317,7 +317,13 @@ function downloadIcons(buildFolder: string) {
|
||||
return Promise.all(
|
||||
iconURLs.map(({name, size, density}) => {
|
||||
const url = getIconURL(name, size, density);
|
||||
return fetch(url, {})
|
||||
return fetch(url, {
|
||||
retryOptions: {
|
||||
// Be default, only 5xx are retried but we're getting the odd 404
|
||||
// which goes away on a retry for some reason.
|
||||
retryOnHttpResponse: (res) => res.status >= 400,
|
||||
},
|
||||
})
|
||||
.then((res) => {
|
||||
if (res.status !== 200) {
|
||||
throw new Error(
|
||||
|
||||
Reference in New Issue
Block a user