add log to createAsset retry

This commit is contained in:
João Moreno 2020-12-07 19:56:05 +01:00
parent ab8c8dbd8e
commit 3655a82edc

View file

@ -75,8 +75,11 @@ async function retry<T>(fn: () => Promise<T>): Promise<T> {
throw err;
}
const millis = (Math.random() * 200) + (50 * Math.pow(1.5, run));
console.log(`Creating build asset failed with ECONNRESET, retrying in ${millis}ms...`);
// maximum delay is 10th retry: ~3 seconds
await new Promise(c => setTimeout(c, (Math.random() * 200) + (50 * Math.pow(1.5, run))));
await new Promise(c => setTimeout(c, millis));
}
}