mirror of
https://github.com/chatmail/core.git
synced 2026-05-16 21:36:30 +03:00
fix: chat::save_msgs: Interrupt inbox loop to send a sync message
Also fix the `send_sync_msg()` documentation: now it's called from the inbox loop, not SMTP (because `IMAP APPEND` is used to upload sync messages).
This commit is contained in:
@@ -4374,7 +4374,7 @@ pub async fn save_msgs(context: &Context, msg_ids: &[MsgId]) -> Result<()> {
|
|||||||
})
|
})
|
||||||
.await?;
|
.await?;
|
||||||
}
|
}
|
||||||
context.send_sync_msg().await?;
|
context.scheduler.interrupt_inbox().await;
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -169,7 +169,7 @@ impl Context {
|
|||||||
///
|
///
|
||||||
/// Mustn't be called from multiple tasks in parallel to avoid sending the same sync items twice
|
/// Mustn't be called from multiple tasks in parallel to avoid sending the same sync items twice
|
||||||
/// because sync items are removed from the db only after successful sending. We guarantee this
|
/// because sync items are removed from the db only after successful sending. We guarantee this
|
||||||
/// by calling `send_sync_msg()` only from the SMTP loop.
|
/// by calling `send_sync_msg()` only from the inbox loop.
|
||||||
pub async fn send_sync_msg(&self) -> Result<Option<MsgId>> {
|
pub async fn send_sync_msg(&self) -> Result<Option<MsgId>> {
|
||||||
if let Some((json, ids)) = self.build_sync_json().await? {
|
if let Some((json, ids)) = self.build_sync_json().await? {
|
||||||
let chat_id =
|
let chat_id =
|
||||||
|
|||||||
Reference in New Issue
Block a user