mirror of
https://github.com/chatmail/core.git
synced 2026-05-06 16:36:59 +03:00
Don't unnecessarily interrupt ephemeral loop (#3221)
Follow-up for #3211
This commit is contained in:
12
src/imap.rs
12
src/imap.rs
@@ -458,13 +458,15 @@ impl Imap {
|
|||||||
}
|
}
|
||||||
self.prepare(context).await?;
|
self.prepare(context).await?;
|
||||||
|
|
||||||
if self
|
let msgs_fetched = self
|
||||||
.fetch_new_messages(context, watch_folder, false)
|
.fetch_new_messages(context, watch_folder, false)
|
||||||
.await
|
.await
|
||||||
.context("fetch_new_messages")?
|
.context("fetch_new_messages")?;
|
||||||
{
|
if msgs_fetched && context.get_config_delete_device_after().await?.is_some() {
|
||||||
// New messages were fetched, restart ephemeral loop in case these messages will expire
|
// New messages were fetched and shall be deleted later, restart ephemeral loop.
|
||||||
// later.
|
// Note that the `Config::DeleteDeviceAfter` timer starts as soon as the messages are
|
||||||
|
// fetched while the per-chat ephemeral timers start as soon as the messages are marked
|
||||||
|
// as noticed.
|
||||||
context.interrupt_ephemeral_task().await;
|
context.interrupt_ephemeral_task().await;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user