some more logging

This commit is contained in:
holger krekel
2019-11-11 10:16:02 +01:00
parent 1077cf5e99
commit 55ada1cd89
2 changed files with 10 additions and 1 deletions

View File

@@ -427,15 +427,19 @@ class TestOnlineAccount:
assert self_addr not in ev[2]
ev = ac1._evlogger.get_matching("DC_EVENT_DELETED_BLOB_FILE")
def test_mvbox_sentbox_threads(self, acfactory):
def test_mvbox_sentbox_threads(self, acfactory, lp):
ac1 = acfactory.get_online_configuring_account(mvbox=True, sentbox=True)
ac2 = acfactory.get_online_configuring_account()
wait_configuration_progress(ac2, 1000)
wait_configuration_progress(ac1, 1000)
lp.sec("configuration completed for both accounts")
chat = self.get_chat(ac1, ac2)
lp.sec("ac1: send text to chat with ac2")
chat.send_text("message1")
lp.sec("ac2: wait for incoming message")
ev = ac2._evlogger.get_matching("DC_EVENT_INCOMING_MSG|DC_EVENT_MSGS_CHANGED")
assert ev[2] > const.DC_CHAT_ID_LAST_SPECIAL
lp.sec("message arrived, test ends")
def test_move_works(self, acfactory):
ac1 = acfactory.get_online_configuring_account()

View File

@@ -398,6 +398,7 @@ impl Imap {
async fn select_folder<S: AsRef<str>>(&self, context: &Context, folder: Option<S>) -> usize {
if self.session.lock().await.is_none() {
info!(context, "select_folder detects there is a shutdown ongoing");
let mut cfg = self.config.write().await;
cfg.selected_folder = None;
cfg.selected_folder_needs_expunge = false;
@@ -748,13 +749,16 @@ impl Imap {
pub fn idle(&self, context: &Context) {
task::block_on(async move {
info!(context, "imap.idle entered");
if !self.config.read().await.can_idle {
self.fake_idle(context).await;
return;
}
info!(context, "setting up handle if needed");
self.setup_handle_if_needed(context);
info!(context, "select watch folder");
let watch_folder = self.config.read().await.watch_folder.clone();
if self.select_folder(context, watch_folder.as_ref()).await == 0 {
warn!(context, "IMAP-IDLE not setup.");
@@ -763,6 +767,7 @@ impl Imap {
return;
}
info!(context, "starting to enter idle loop");
let session = self.session.lock().await.take();
let timeout = Duration::from_secs(23 * 60);
if let Some(session) = session {