mirror of
https://github.com/chatmail/core.git
synced 2026-05-02 21:06:31 +03:00
feat: log when background fetch of all accounts finishes successfully
This commit is contained in:
@@ -353,11 +353,11 @@ impl Accounts {
|
|||||||
/// This is an auxiliary function and not part of public API.
|
/// This is an auxiliary function and not part of public API.
|
||||||
/// Use [Accounts::background_fetch] instead.
|
/// Use [Accounts::background_fetch] instead.
|
||||||
async fn background_fetch_no_timeout(accounts: Vec<Context>, events: Events) {
|
async fn background_fetch_no_timeout(accounts: Vec<Context>, events: Events) {
|
||||||
|
let n_accounts = accounts.len();
|
||||||
events.emit(Event {
|
events.emit(Event {
|
||||||
id: 0,
|
id: 0,
|
||||||
typ: EventType::Info(format!(
|
typ: EventType::Info(format!(
|
||||||
"Starting background fetch for {} accounts.",
|
"Starting background fetch for {n_accounts} accounts."
|
||||||
accounts.len()
|
|
||||||
)),
|
)),
|
||||||
});
|
});
|
||||||
let mut set = JoinSet::new();
|
let mut set = JoinSet::new();
|
||||||
@@ -369,6 +369,12 @@ impl Accounts {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
set.join_all().await;
|
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].
|
/// Auxiliary function for [Accounts::background_fetch].
|
||||||
|
|||||||
Reference in New Issue
Block a user