]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-storage: When doing a fast sync, refresh index to see if it had any changes.
authorTimo Sirainen <tss@iki.fi>
Wed, 21 Aug 2013 17:03:13 +0000 (20:03 +0300)
committerTimo Sirainen <tss@iki.fi>
Wed, 21 Aug 2013 17:03:13 +0000 (20:03 +0300)
I'm pretty sure this used to be done earlier, but probably some
optimizations dropped it at some point.

src/lib-storage/index/index-sync.c

index 58e45162abd83465eb98343c5bc5e60d3f619861..58c43b998a61cf49edda9257a59c7bb092337a33 100644 (file)
@@ -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,