Skip to content

Commit

Permalink
fix: try consecutive accounts loading
Browse files Browse the repository at this point in the history
  • Loading branch information
doomsower committed Dec 11, 2024
1 parent d4386ed commit 1caaff0
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/services/scanner/Scanner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -318,10 +318,12 @@ export class Scanner {
selection: AccountSelection,
): Promise<CreditAccountDataRaw[]> {
const { liquidatableOnly, blockNumber } = selection;
const all = await Promise.all(
cms.map(cm => this.#getAccountsFromManager(cm, selection)),
);
const accs = all.flat();
const accs: CreditAccountDataRaw[] = [];
// do not use Promise.all, because it crashes anvil
for (const cm of cms) {
const accsFromCM = await this.#getAccountsFromManager(cm, selection);
accs.push(...accsFromCM);
}
this.log.debug(
`loaded ${accs.length} credit accounts from ${cms.length} credit managers`,
);
Expand Down

0 comments on commit 1caaff0

Please sign in to comment.