From 6df1d165dd9e516d96c3b9ca3be11f367ad25216 Mon Sep 17 00:00:00 2001 From: link2xt Date: Wed, 16 Jul 2025 11:39:42 +0000 Subject: [PATCH] feat: log when background fetch of all accounts finishes successfully --- src/accounts.rs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/accounts.rs b/src/accounts.rs index 1b1408b08..ef36ffe96 100644 --- a/src/accounts.rs +++ b/src/accounts.rs @@ -353,11 +353,11 @@ impl Accounts { /// This is an auxiliary function and not part of public API. /// Use [Accounts::background_fetch] instead. async fn background_fetch_no_timeout(accounts: Vec, events: Events) { + let n_accounts = accounts.len(); events.emit(Event { id: 0, typ: EventType::Info(format!( - "Starting background fetch for {} accounts.", - accounts.len() + "Starting background fetch for {n_accounts} accounts." )), }); let mut set = JoinSet::new(); @@ -369,6 +369,12 @@ impl Accounts { }); } set.join_all().await; + events.emit(Event { + id: 0, + typ: EventType::Info(format!( + "Finished background fetch for {n_accounts} accounts." + )), + }); } /// Auxiliary function for [Accounts::background_fetch].