changeset 7611:5f481022db04 HEAD

maildir: Write dovecot-uidlist before syncing index to make sure that any new messages' filenames are available immediately when they're seen in index.
author Timo Sirainen <tss@iki.fi>
date Fri, 06 Jun 2008 17:15:14 +0300
parents 280e570a5ced
children 5824e6f1d279
files src/lib-storage/index/maildir/maildir-uidlist.c
diffstat 1 files changed, 7 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/src/lib-storage/index/maildir/maildir-uidlist.c	Wed Jun 04 20:32:33 2008 +0300
+++ b/src/lib-storage/index/maildir/maildir-uidlist.c	Fri Jun 06 17:15:14 2008 +0300
@@ -1550,6 +1550,13 @@
 
 	ctx->finished = TRUE;
 	ctx->uidlist->initial_sync = TRUE;
+
+	i_assert(ctx->locked || !ctx->changed);
+	if ((ctx->changed || ctx->uidlist->recreate) &&
+	    !ctx->failed && ctx->locked) T_BEGIN {
+		if (maildir_uidlist_sync_update(ctx) < 0)
+			ctx->failed = TRUE;
+	} T_END;
 }
 
 int maildir_uidlist_sync_deinit(struct maildir_uidlist_sync_ctx **_ctx)
@@ -1561,18 +1568,8 @@
 
 	if (!ctx->finished)
 		maildir_uidlist_sync_finish(ctx);
-
 	if (ctx->partial)
 		maildir_uidlist_mark_all(ctx->uidlist, FALSE);
-
-	i_assert(ctx->locked || !ctx->changed);
-	if ((ctx->changed || ctx->uidlist->recreate) &&
-	    !ctx->failed && ctx->locked) {
-		T_BEGIN {
-			ret = maildir_uidlist_sync_update(ctx);
-		} T_END;
-	}
-
 	if (ctx->locked)
 		maildir_uidlist_unlock(ctx->uidlist);