|
@@ -408,13 +408,21 @@ pub fn check_for_updates(mailbox: String) -> JoinHandle<Result<(), anyhow::Error
|
|
|
_ => {}
|
|
|
}
|
|
|
}
|
|
|
- reason => {
|
|
|
- println!("IDLE failed {:?}", reason);
|
|
|
- }
|
|
|
+ _ => {}
|
|
|
}
|
|
|
|
|
|
// Reassign session to prevent ownership issues in the next loop iteration
|
|
|
- session = idle.done().await.unwrap();
|
|
|
+ let mut error = false;
|
|
|
+ session = match idle.done().await {
|
|
|
+ Ok(idl) => idl,
|
|
|
+ Err(_) => {
|
|
|
+ error = true;
|
|
|
+ get_session().await?
|
|
|
+ }
|
|
|
+ };
|
|
|
+ if error == true{
|
|
|
+ session.select(mailbox.clone()).await?;
|
|
|
+ }
|
|
|
}
|
|
|
})
|
|
|
}
|