Don't fetch from INBOX if it is disabled

Before, if there were more than 20 jobs at once, we unconditionally
fetched from inbox
This commit is contained in:
Hocuri
2020-11-16 16:14:40 +01:00
committed by holger krekel
parent 8d2a5cd242
commit c8d4eee794

View File

@@ -69,9 +69,11 @@ async fn inbox_loop(ctx: Context, started: Sender<()>, inbox_handlers: ImapConne
}
Some(job) => {
// Let the fetch run, but return back to the job afterwards.
info!(ctx, "postponing imap-job {} to run fetch...", job);
jobs_loaded = 0;
fetch(&ctx, &mut connection).await;
if ctx.get_config_bool(Config::InboxWatch).await {
info!(ctx, "postponing imap-job {} to run fetch...", job);
fetch(&ctx, &mut connection).await;
}
}
None => {
jobs_loaded = 0;