resultify

This commit is contained in:
link2xt
2026-04-11 08:46:16 +02:00
parent ae8cbb3cf3
commit f640c65a00
3 changed files with 7 additions and 4 deletions

View File

@@ -323,7 +323,7 @@ impl CommandApi {
/// I/O must be started for this request to take effect.
async fn clear_all_relay_storage(&self, account_id: u32) -> Result<()> {
let ctx = self.get_context(account_id).await?;
ctx.clear_all_relay_storage().await;
ctx.clear_all_relay_storage().await?;
Ok(())
}

View File

@@ -565,8 +565,8 @@ impl Context {
/// Non-chatmail relays are excluded
/// to avoid accidentally deleting emails
/// from shared inboxes.
pub async fn clear_all_relay_storage(&self) {
self.scheduler.clear_all_relay_storage().await;
pub async fn clear_all_relay_storage(&self) -> Result<()> {
self.scheduler.clear_all_relay_storage().await
}
/// Restarts the IO scheduler if it was running before

View File

@@ -256,10 +256,13 @@ impl SchedulerState {
}
}
pub(crate) async fn clear_all_relay_storage(&self) {
pub(crate) async fn clear_all_relay_storage(&self) -> Result<()> {
let inner = self.inner.read().await;
if let InnerSchedulerState::Started(ref scheduler) = *inner {
scheduler.clear_all_relay_storage();
Ok(())
} else {
bail!("IO is not started");
}
}