Skip to content

Commit

Permalink
recover account error log improve
Browse files Browse the repository at this point in the history
  • Loading branch information
gaetbout committed Apr 17, 2024
1 parent 5af0863 commit 54d4e8c
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions scripts/stress-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -151,12 +151,13 @@ async function tryRecoverAccount(account: Account, time: number, accounts: Accou
console.log(`\t${getFormattedDate()} Account ${account.address} successfully recovered`);
accounts.push(account);
} catch (e) {
console.log(`\t${getFormattedDate()} Couldn't recover ${account.address}, retrying in ${time * 2}`);
console.log(e);
if (time >= 60_000) {
await tryRecoverAccount(account, time, accounts);
console.log(`\t${getFormattedDate()} Couldn't recover ${account.address}, retrying in ${time}`);
await tryRecoverAccount(account, 60_000, accounts);
} else {
await tryRecoverAccount(account, time * 1.5, accounts);
console.log(`\t${getFormattedDate()} Couldn't recover ${account.address}, retrying in ${time * 2}`);
await tryRecoverAccount(account, time * 2, accounts);
}
}
}, time),
Expand Down

0 comments on commit 54d4e8c

Please sign in to comment.