From: Timo Sirainen Date: Wed, 21 Aug 2013 17:03:13 +0000 (+0300) Subject: lib-storage: When doing a fast sync, refresh index to see if it had any changes. X-Git-Tag: 2.2.6~126 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=2f1853d15059f374a0450b52d32f7800cc40dc40;p=thirdparty%2Fdovecot%2Fcore.git lib-storage: When doing a fast sync, refresh index to see if it had any changes. I'm pretty sure this used to be done earlier, but probably some optimizations dropped it at some point. --- diff --git a/src/lib-storage/index/index-sync.c b/src/lib-storage/index/index-sync.c index 58e45162ab..58c43b998a 100644 --- a/src/lib-storage/index/index-sync.c +++ b/src/lib-storage/index/index-sync.c @@ -218,6 +218,11 @@ index_mailbox_sync_init(struct mailbox *box, enum mailbox_sync_flags flags, mail_index_view_get_messages_count(box->view); } + if ((flags & MAILBOX_SYNC_FLAG_FAST) != 0) { + /* we most likely did a fast sync. refresh the index anyway in + case there were some new changes. */ + (void)mail_index_refresh(box->index); + } ctx->sync_ctx = mail_index_view_sync_begin(box->view, sync_flags); if ((flags & MAILBOX_SYNC_FLAG_NO_EXPUNGES) == 0) { mail_index_view_sync_get_expunges(ctx->sync_ctx,