melib/imap: don't retry watch conn on non-network error

pull/144/head
Manos Pitsidianakis 4 years ago
parent 76814cea20
commit 1408690a9a
No known key found for this signature in database
GPG Key ID: 73627C2F690DF710

@ -499,6 +499,8 @@ impl MailBackend for ImapType {
let mut main_conn_lck = timeout(uid_store.timeout, main_conn.lock()).await?;
if err.kind.is_network() {
uid_store.is_online.lock().unwrap().1 = Err(err.clone());
} else {
return Err(err);
}
debug!("Watch failure: {}", err.to_string());
match timeout(uid_store.timeout, main_conn_lck.connect())

@ -408,14 +408,16 @@ pub async fn examine_updates(
}
}
if uid_store.keep_offline_cache {
cache_handle
.insert_envelopes(mailbox_hash, &v)
.chain_err_summary(|| {
format!(
"Could not save envelopes in cache for mailbox {}",
mailbox.imap_path()
)
})?;
if !cache_handle.mailbox_state(mailbox_hash)?.is_none() {
cache_handle
.insert_envelopes(mailbox_hash, &v)
.chain_err_summary(|| {
format!(
"Could not save envelopes in cache for mailbox {}",
mailbox.imap_path()
)
})?;
}
}
for FetchResponse { uid, envelope, .. } in v {

Loading…
Cancel
Save