rename event and mention event in method documentation

This commit is contained in:
Simon Laux
2024-01-12 21:20:43 +01:00
committed by bjoern
parent df455bbcf5
commit 727428a965
4 changed files with 19 additions and 3 deletions

View File

@@ -295,6 +295,10 @@ impl Accounts {
/// Performs a background fetch for all accounts in parallel.
///
/// If you need a timeout, then use [Accounts::background_fetch_with_timeout] instead.
///
/// The `BackgroundFetchCompletedForAllAccounts` event is emitted at the end,
/// process all events until you get this one and you can safely return to the background
/// without forgeting to create notifications caused by timing race conditions.
pub async fn background_fetch(&self) {
async fn background_fetch_and_log_error(account: Context) {
if let Err(error) = account.background_fetch().await {
@@ -316,6 +320,10 @@ impl Accounts {
/// Performs a background fetch for all accounts in parallel with a timeout.
///
/// If you want no timeout, then use [Accounts::background_fetch] instead.
///
/// The `BackgroundFetchCompletedForAllAccounts` event is emitted at the end,
/// process all events until you get this one and you can safely return to the background
/// without forgeting to create notifications caused by timing race conditions.
pub async fn background_fetch_with_timeout(&self, timeout: std::time::Duration) -> Result<()> {
let result = tokio::time::timeout(timeout, self.background_fetch()).await;
self.emit_event(EventType::BackgroundFetchCompletedForAllAccounts);