mirror of
https://github.com/chatmail/core.git
synced 2026-04-26 09:56:35 +03:00
fix: renew IDLE timeout on keepalives and reduce it to 5 minutes
This change depends on async-imap update that resets the timeout every time an `* OK Still here` is received. Reducing timeout allows to detect lost connections not later than 6 minutes because Delta Chat will attempt to finish IDLE with DONE after 5 minutes without keepalives and will either get TCP RST directly or, worst case, wait another minute for TCP socket read timeout.
This commit is contained in:
@@ -12,7 +12,13 @@ use crate::context::Context;
|
||||
use crate::imap::{client::IMAP_TIMEOUT, FolderMeaning};
|
||||
use crate::log::LogExt;
|
||||
|
||||
const IDLE_TIMEOUT: Duration = Duration::from_secs(23 * 60);
|
||||
/// Timeout after which IDLE is finished
|
||||
/// if there are no responses from the server.
|
||||
///
|
||||
/// If `* OK Still here` keepalives are sent more frequently
|
||||
/// than this duration, timeout should never be triggered.
|
||||
/// For example, Dovecot sends keepalives every 2 minutes by default.
|
||||
const IDLE_TIMEOUT: Duration = Duration::from_secs(5 * 60);
|
||||
|
||||
impl Session {
|
||||
pub async fn idle(
|
||||
|
||||
Reference in New Issue
Block a user