Add verbose logging for #2065

This commit is contained in:
Hocuri
2020-11-10 13:06:04 +01:00
parent 2a9d06d817
commit 83df69f43c
2 changed files with 10 additions and 0 deletions

View File

@@ -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);

View File

@@ -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() {