mirror of
https://github.com/chatmail/core.git
synced 2026-05-04 05:46:29 +03:00
some more logging
This commit is contained in:
@@ -427,15 +427,19 @@ class TestOnlineAccount:
|
|||||||
assert self_addr not in ev[2]
|
assert self_addr not in ev[2]
|
||||||
ev = ac1._evlogger.get_matching("DC_EVENT_DELETED_BLOB_FILE")
|
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)
|
ac1 = acfactory.get_online_configuring_account(mvbox=True, sentbox=True)
|
||||||
ac2 = acfactory.get_online_configuring_account()
|
ac2 = acfactory.get_online_configuring_account()
|
||||||
wait_configuration_progress(ac2, 1000)
|
wait_configuration_progress(ac2, 1000)
|
||||||
wait_configuration_progress(ac1, 1000)
|
wait_configuration_progress(ac1, 1000)
|
||||||
|
lp.sec("configuration completed for both accounts")
|
||||||
chat = self.get_chat(ac1, ac2)
|
chat = self.get_chat(ac1, ac2)
|
||||||
|
lp.sec("ac1: send text to chat with ac2")
|
||||||
chat.send_text("message1")
|
chat.send_text("message1")
|
||||||
|
lp.sec("ac2: wait for incoming message")
|
||||||
ev = ac2._evlogger.get_matching("DC_EVENT_INCOMING_MSG|DC_EVENT_MSGS_CHANGED")
|
ev = ac2._evlogger.get_matching("DC_EVENT_INCOMING_MSG|DC_EVENT_MSGS_CHANGED")
|
||||||
assert ev[2] > const.DC_CHAT_ID_LAST_SPECIAL
|
assert ev[2] > const.DC_CHAT_ID_LAST_SPECIAL
|
||||||
|
lp.sec("message arrived, test ends")
|
||||||
|
|
||||||
def test_move_works(self, acfactory):
|
def test_move_works(self, acfactory):
|
||||||
ac1 = acfactory.get_online_configuring_account()
|
ac1 = acfactory.get_online_configuring_account()
|
||||||
|
|||||||
@@ -398,6 +398,7 @@ impl Imap {
|
|||||||
|
|
||||||
async fn select_folder<S: AsRef<str>>(&self, context: &Context, folder: Option<S>) -> usize {
|
async fn select_folder<S: AsRef<str>>(&self, context: &Context, folder: Option<S>) -> usize {
|
||||||
if self.session.lock().await.is_none() {
|
if self.session.lock().await.is_none() {
|
||||||
|
info!(context, "select_folder detects there is a shutdown ongoing");
|
||||||
let mut cfg = self.config.write().await;
|
let mut cfg = self.config.write().await;
|
||||||
cfg.selected_folder = None;
|
cfg.selected_folder = None;
|
||||||
cfg.selected_folder_needs_expunge = false;
|
cfg.selected_folder_needs_expunge = false;
|
||||||
@@ -748,13 +749,16 @@ impl Imap {
|
|||||||
|
|
||||||
pub fn idle(&self, context: &Context) {
|
pub fn idle(&self, context: &Context) {
|
||||||
task::block_on(async move {
|
task::block_on(async move {
|
||||||
|
info!(context, "imap.idle entered");
|
||||||
if !self.config.read().await.can_idle {
|
if !self.config.read().await.can_idle {
|
||||||
self.fake_idle(context).await;
|
self.fake_idle(context).await;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
info!(context, "setting up handle if needed");
|
||||||
self.setup_handle_if_needed(context);
|
self.setup_handle_if_needed(context);
|
||||||
|
|
||||||
|
info!(context, "select watch folder");
|
||||||
let watch_folder = self.config.read().await.watch_folder.clone();
|
let watch_folder = self.config.read().await.watch_folder.clone();
|
||||||
if self.select_folder(context, watch_folder.as_ref()).await == 0 {
|
if self.select_folder(context, watch_folder.as_ref()).await == 0 {
|
||||||
warn!(context, "IMAP-IDLE not setup.");
|
warn!(context, "IMAP-IDLE not setup.");
|
||||||
@@ -763,6 +767,7 @@ impl Imap {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
info!(context, "starting to enter idle loop");
|
||||||
let session = self.session.lock().await.take();
|
let session = self.session.lock().await.take();
|
||||||
let timeout = Duration::from_secs(23 * 60);
|
let timeout = Duration::from_secs(23 * 60);
|
||||||
if let Some(session) = session {
|
if let Some(session) = session {
|
||||||
|
|||||||
Reference in New Issue
Block a user