mirror of
https://github.com/chatmail/core.git
synced 2026-04-21 15:36:30 +03:00
fix imap fetch loop and watch folders
This commit is contained in:
@@ -269,8 +269,12 @@ async fn start(args: Vec<String>) -> Result<(), failure::Error> {
|
||||
|
||||
let ctx = context.clone();
|
||||
std::thread::spawn(move || loop {
|
||||
if let Ok(event) = ctx.get_next_event() {
|
||||
receive_event(event);
|
||||
if ctx.has_next_event() {
|
||||
if let Ok(event) = ctx.get_next_event() {
|
||||
receive_event(event);
|
||||
}
|
||||
} else {
|
||||
std::thread::sleep(std::time::Duration::from_millis(50));
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user