trying trying

This commit is contained in:
holger krekel
2020-05-24 17:36:25 +02:00
parent 89fec474d4
commit 502d675b70

View File

@@ -589,12 +589,14 @@ impl Imap {
let set = format!("{}:*", last_seen_uid + 1); let set = format!("{}:*", last_seen_uid + 1);
info!(context, "fetch_new_messages {:?}", set); info!(context, "fetch_new_messages {:?}", set);
let mut list = match session.uid_fetch(set, PREFETCH_FLAGS).await { let mut list = match session.uid_fetch(&set, PREFETCH_FLAGS).await {
Ok(list) => list, Ok(list) => list,
Err(err) => { Err(err) => {
warn!(context, "ERROR: fetch_new_messages {:?} -> {:?}", &set, err);
return Err(Error::FetchFailed(err)); return Err(Error::FetchFailed(err));
} }
}; };
info!(context, "fetch_new_messages {:?} RETURNED", &set);
let mut msgs = Vec::new(); let mut msgs = Vec::new();
while let Some(fetch) = list.next().await { while let Some(fetch) = list.next().await {
@@ -602,6 +604,7 @@ impl Imap {
msgs.push(fetch); msgs.push(fetch);
} }
drop(list); drop(list);
info!(context, "fetch_new_messages got {:?} messsages", msgs.len());
msgs.sort_unstable_by_key(|msg| msg.uid.unwrap_or_default()); msgs.sort_unstable_by_key(|msg| msg.uid.unwrap_or_default());
let msgs: Vec<_> = msgs let msgs: Vec<_> = msgs
@@ -693,6 +696,11 @@ impl Imap {
} }
} }
info!(
context,
"fetch_many_msgs fetching {} messages in batch",
uids.len()
);
// check passed, go fetch the emails // check passed, go fetch the emails
let (new_last_seen_uid_processed, error_cnt) = let (new_last_seen_uid_processed, error_cnt) =
self.fetch_many_msgs(context, &folder, &uids).await; self.fetch_many_msgs(context, &folder, &uids).await;