changeset 11953:a933f7db45f9

dict quota: Don't fail quota recalculation if mailbox syncing fails with non-temp error. This could happen e.g. with mbox if a file isn't in a valid mbox.
author Timo Sirainen <tss@iki.fi>
date Fri, 06 Aug 2010 16:01:20 +0100
parents 4ef2280ee490
children e54df5af98ac
files src/plugins/quota/quota-count.c
diffstat 1 files changed, 1 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/src/plugins/quota/quota-count.c	Fri Aug 06 15:11:06 2010 +0100
+++ b/src/plugins/quota/quota-count.c	Fri Aug 06 16:01:20 2010 +0100
@@ -32,7 +32,7 @@
 
 	box = mailbox_alloc(ns->list, storage_name,
 			    MAILBOX_FLAG_READONLY | MAILBOX_FLAG_KEEP_RECENT);
-	if (mailbox_open(box) < 0) {
+	if (mailbox_sync(box, MAILBOX_SYNC_FLAG_FULL_READ) < 0) {
 		mail_storage_get_last_error(mailbox_get_storage(box), &error);
 		mailbox_free(&box);
 		if (error == MAIL_ERROR_TEMP)
@@ -41,11 +41,6 @@
 		return 0;
 	}
 
-	if (mailbox_sync(box, MAILBOX_SYNC_FLAG_FULL_READ) < 0) {
-		mailbox_free(&box);
-		return -1;
-	}
-
 	trans = mailbox_transaction_begin(box, 0);
 	mail = mail_alloc(trans, MAIL_FETCH_PHYSICAL_SIZE, NULL);