]> 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>
Tue, 10 Oct 2017 17:14:09 +0000 (20:14 +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 f3cf94113dddcc9e8a80c1fadb9868d9aaa703b9..98379ffb0c557b67e241cef187f19d034145c33a 100644 (file)
@@ -937,6 +937,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);
 }