From 28ca2fe17f4a2a106deb169c400b3bb8e890f2a4 Mon Sep 17 00:00:00 2001 From: Timo Sirainen Date: Mon, 11 Sep 2017 13:48:17 +0300 Subject: [PATCH] lib-storage: Make sure mailbox list notification flush sees latest changes. 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 | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/lib-storage/list/mailbox-list-index-notify.c b/src/lib-storage/list/mailbox-list-index-notify.c index f3cf94113d..98379ffb0c 100644 --- a/src/lib-storage/list/mailbox-list-index-notify.c +++ b/src/lib-storage/list/mailbox-list-index-notify.c @@ -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); } -- 2.47.3