You've already forked matrix-js-sdk
mirror of
https://github.com/matrix-org/matrix-js-sdk.git
synced 2025-11-26 17:03:12 +03:00
log while retrying
This commit is contained in:
@@ -757,6 +757,7 @@ export async function retryNetworkOperation(maxAttempts, callback) {
|
|||||||
try {
|
try {
|
||||||
if (attempts > 0) {
|
if (attempts > 0) {
|
||||||
const timeout = 1000 * Math.pow(2, attempts);
|
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));
|
await new Promise(r => setTimeout(r, timeout));
|
||||||
}
|
}
|
||||||
return await callback();
|
return await callback();
|
||||||
|
|||||||
Reference in New Issue
Block a user