mirror of
https://github.com/chatmail/core.git
synced 2026-04-17 13:36:30 +03:00
Add verbose logging for #2065
This commit is contained in:
@@ -21,13 +21,16 @@ impl Imap {
|
||||
watch_folder: Option<String>,
|
||||
) -> Result<InterruptInfo> {
|
||||
use futures::future::FutureExt;
|
||||
info!(context, "verbose (issue 2065): step 2 starting idle");
|
||||
|
||||
if !self.can_idle() {
|
||||
bail!("IMAP server does not have IDLE capability");
|
||||
}
|
||||
self.setup_handle(context).await?;
|
||||
info!(context, "verbose (issue 2065): step 3 setup handle");
|
||||
|
||||
self.select_folder(context, watch_folder.clone()).await?;
|
||||
info!(context, "verbose (issue 2065): step 4 selected folder");
|
||||
|
||||
let timeout = Duration::from_secs(23 * 60);
|
||||
let mut info = Default::default();
|
||||
@@ -44,9 +47,14 @@ impl Imap {
|
||||
_ => info!(context, "ignoring unsolicited response {:?}", response),
|
||||
}
|
||||
}
|
||||
info!(context, "verbose (issue 2065): step 5 checked responsed");
|
||||
|
||||
if unsolicited_exists {
|
||||
self.session = Some(session);
|
||||
info!(
|
||||
context,
|
||||
"verbose (issue 2065): exiting because unsolicited_exists"
|
||||
);
|
||||
return Ok(info);
|
||||
}
|
||||
|
||||
@@ -54,6 +62,7 @@ impl Imap {
|
||||
if let Err(err) = handle.init().await {
|
||||
bail!("IMAP IDLE protocol failed to init/complete: {}", err);
|
||||
}
|
||||
info!(context, "verbose (issue 2065): step 6 inited handle");
|
||||
|
||||
let (idle_wait, interrupt) = handle.wait_with_timeout(timeout);
|
||||
|
||||
|
||||
@@ -141,6 +141,7 @@ async fn fetch_idle(ctx: &Context, connection: &mut Imap, folder: Config) -> Int
|
||||
connection.trigger_reconnect();
|
||||
warn!(ctx, "{}", err);
|
||||
}
|
||||
info!(ctx, "verbose (issue 2065): step 1 done fetching");
|
||||
|
||||
// idle
|
||||
if connection.can_idle() {
|
||||
|
||||
Reference in New Issue
Block a user