log while retrying

This commit is contained in:
Bruno Windels
2020-04-23 15:25:10 +02:00
parent 3a3f6cb7ca
commit e0660ce01c
+1
View File
@@ -757,6 +757,7 @@ export async function retryNetworkOperation(maxAttempts, callback) {
try {
if (attempts > 0) {
const timeout = 1000 * Math.pow(2, attempts);
console.log(`network operation failed ${attempts} times, retrying in ${timeout}ms...`);
await new Promise(r => setTimeout(r, timeout));
}
return await callback();