]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
dsync: Don't repeatedly try to keep opening the same failing mailbox.
authorTimo Sirainen <tss@iki.fi>
Sun, 4 Apr 2010 22:54:28 +0000 (01:54 +0300)
committerTimo Sirainen <tss@iki.fi>
Sun, 4 Apr 2010 22:54:28 +0000 (01:54 +0300)
--HG--
branch : HEAD

src/dsync/dsync-worker-local.c

index 3a51b7da6cf882c490b9ad0b3c9c6a069ffa6e32..a298a9b43d0603052c5295a94b596e9123574e2f 100644 (file)
@@ -1295,13 +1295,13 @@ local_worker_select_mailbox(struct dsync_worker *_worker,
                (struct local_dsync_worker *)_worker;
        struct mailbox_transaction_context *trans, *ext_trans;
 
-       if (worker->selected_box != NULL) {
-               if (dsync_guid_equals(&worker->selected_box_guid, mailbox)) {
-                       /* already selected */
-                       return;
-               }
-               local_worker_mailbox_close(worker);
+       if (dsync_guid_equals(&worker->selected_box_guid, mailbox)) {
+               /* already selected or previous select failed */
+               i_assert(worker->selected_box != NULL || _worker->failed);
+               return;
        }
+       if (worker->selected_box != NULL)
+               local_worker_mailbox_close(worker);
        worker->selected_box_guid = *mailbox;
 
        if (local_mailbox_open(worker, mailbox, &worker->selected_box) < 0) {