mirror of
https://github.com/chatmail/core.git
synced 2026-05-11 02:46:30 +03:00
resultify
This commit is contained in:
@@ -323,7 +323,7 @@ impl CommandApi {
|
|||||||
/// I/O must be started for this request to take effect.
|
/// I/O must be started for this request to take effect.
|
||||||
async fn clear_all_relay_storage(&self, account_id: u32) -> Result<()> {
|
async fn clear_all_relay_storage(&self, account_id: u32) -> Result<()> {
|
||||||
let ctx = self.get_context(account_id).await?;
|
let ctx = self.get_context(account_id).await?;
|
||||||
ctx.clear_all_relay_storage().await;
|
ctx.clear_all_relay_storage().await?;
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -565,8 +565,8 @@ impl Context {
|
|||||||
/// Non-chatmail relays are excluded
|
/// Non-chatmail relays are excluded
|
||||||
/// to avoid accidentally deleting emails
|
/// to avoid accidentally deleting emails
|
||||||
/// from shared inboxes.
|
/// from shared inboxes.
|
||||||
pub async fn clear_all_relay_storage(&self) {
|
pub async fn clear_all_relay_storage(&self) -> Result<()> {
|
||||||
self.scheduler.clear_all_relay_storage().await;
|
self.scheduler.clear_all_relay_storage().await
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Restarts the IO scheduler if it was running before
|
/// Restarts the IO scheduler if it was running before
|
||||||
|
|||||||
@@ -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;
|
let inner = self.inner.read().await;
|
||||||
if let InnerSchedulerState::Started(ref scheduler) = *inner {
|
if let InnerSchedulerState::Started(ref scheduler) = *inner {
|
||||||
scheduler.clear_all_relay_storage();
|
scheduler.clear_all_relay_storage();
|
||||||
|
Ok(())
|
||||||
|
} else {
|
||||||
|
bail!("IO is not started");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user