Skip to content

Commit 6df1d16

Browse files
committed
feat: log when background fetch of all accounts finishes successfully
1 parent e03e2d9 commit 6df1d16

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/accounts.rs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -353,11 +353,11 @@ impl Accounts {
353353
/// This is an auxiliary function and not part of public API.
354354
/// Use [Accounts::background_fetch] instead.
355355
async fn background_fetch_no_timeout(accounts: Vec<Context>, events: Events) {
356+
let n_accounts = accounts.len();
356357
events.emit(Event {
357358
id: 0,
358359
typ: EventType::Info(format!(
359-
"Starting background fetch for {} accounts.",
360-
accounts.len()
360+
"Starting background fetch for {n_accounts} accounts."
361361
)),
362362
});
363363
let mut set = JoinSet::new();
@@ -369,6 +369,12 @@ impl Accounts {
369369
});
370370
}
371371
set.join_all().await;
372+
events.emit(Event {
373+
id: 0,
374+
typ: EventType::Info(format!(
375+
"Finished background fetch for {n_accounts} accounts."
376+
)),
377+
});
372378
}
373379

374380
/// Auxiliary function for [Accounts::background_fetch].

0 commit comments

Comments
 (0)