better logging, changed timeout

This commit is contained in:
holger krekel
2019-12-01 12:30:43 +01:00
parent 2582791501
commit 2423d197cd
2 changed files with 4 additions and 4 deletions

View File

@@ -972,7 +972,7 @@ impl Imap {
}) })
} }
pub fn interrupt_idle(&self) { pub fn interrupt_idle(&self, context: &Context) {
task::block_on(async move { task::block_on(async move {
let mut interrupt: Option<stop_token::StopSource> = self.interrupt.lock().await.take(); let mut interrupt: Option<stop_token::StopSource> = self.interrupt.lock().await.take();
if interrupt.is_none() { if interrupt.is_none() {
@@ -988,8 +988,8 @@ impl Imap {
// not have entered idle_wait yet, give it some time // not have entered idle_wait yet, give it some time
// for that to happen. XXX handle this without extra wait // for that to happen. XXX handle this without extra wait
// https://github.com/deltachat/deltachat-core-rust/issues/925 // https://github.com/deltachat/deltachat-core-rust/issues/925
std::thread::sleep(Duration::from_millis(50)); std::thread::sleep(Duration::from_millis(200));
eprintln!("low-level: dropping stop-source to interrupt idle"); info!(context, "low-level: dropping stop-source to interrupt idle");
std::mem::drop(interrupt) std::mem::drop(interrupt)
} }
}); });

View File

@@ -63,7 +63,7 @@ impl JobThread {
info!(context, "Interrupting {}-IDLE...", self.name); info!(context, "Interrupting {}-IDLE...", self.name);
self.imap.interrupt_idle(); self.imap.interrupt_idle(context);
let &(ref lock, ref cvar) = &*self.state.clone(); let &(ref lock, ref cvar) = &*self.state.clone();
let mut state = lock.lock().unwrap(); let mut state = lock.lock().unwrap();