]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-storage: Make sure mailbox list notification flush sees latest changes.
authorTimo Sirainen <timo.sirainen@dovecot.fi>
Mon, 11 Sep 2017 10:48:17 +0000 (13:48 +0300)
committerAki Tuomi <aki.tuomi@dovecot.fi>
Wed, 13 Sep 2017 12:22:09 +0000 (15:22 +0300)
This is mainly useful with imaptest test scripts to make sure they're seeing
the changes done by the other session, without assuming that inotify will
always notify about the change before NOOP is run (it doesn't).

Do this only if mailbox_idle_check_interval>0, so it's not run when periodic
stat()s are wanted to be avoided.

src/lib-storage/list/mailbox-list-index-notify.c

index 64b0123e1c6a58a1b73330c8224ac1b71e4ab4b8..94808710926df88f56b2eb33e2ff0b4d6dc004fd 100644 (file)
@@ -928,6 +928,11 @@ void mailbox_list_index_notify_flush(struct mailbox_list_notify *notify)
        struct mailbox_list_notify_index *inotify =
                (struct mailbox_list_notify_index *)notify;
 
+       if (inotify->to_notify == NULL &&
+           notify->list->mail_set->mailbox_idle_check_interval > 0) {
+               /* no pending notification - check if anything had changed */
+               notify_callback(inotify);
+       }
        if (inotify->to_notify != NULL)
                notify_now_callback(inotify);
 }