api: jsonrpc: add background_fetch_for_all_accounts

This commit is contained in:
Simon Laux
2023-12-12 01:26:10 +01:00
committed by bjoern
parent 7b68098785
commit d2c61dc90e

View File

@@ -231,6 +231,16 @@ impl CommandApi {
Ok(())
}
/// Performs a background fetch for all accounts in parallel with a timeout.
async fn background_fetch_for_all_accounts(&self, timeout_in_seconds: f64) -> Result<()> {
self.accounts
.write()
.await
.background_fetch_with_timeout(std::time::Duration::from_secs_f64(timeout_in_seconds))
.await?;
Ok(())
}
// ---------------------------------------------
// Methods that work on individual accounts
// ---------------------------------------------