From c8d4eee79444275bafe6c6f6ffeaff70f33f3afd Mon Sep 17 00:00:00 2001 From: Hocuri Date: Mon, 16 Nov 2020 16:14:40 +0100 Subject: [PATCH] Don't fetch from INBOX if it is disabled Before, if there were more than 20 jobs at once, we unconditionally fetched from inbox --- src/scheduler.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/scheduler.rs b/src/scheduler.rs index 658712395..84427e65e 100644 --- a/src/scheduler.rs +++ b/src/scheduler.rs @@ -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;