]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
IDLE: After seeing a change, don't check for more changes every 0,5 seconds.
authorTimo Sirainen <tss@iki.fi>
Mon, 9 Nov 2009 20:12:01 +0000 (15:12 -0500)
committerTimo Sirainen <tss@iki.fi>
Mon, 9 Nov 2009 20:12:01 +0000 (15:12 -0500)
--HG--
branch : HEAD

src/lib-storage/index/index-mailbox-check.c

index 624f3147e38e84feb2f915dbf69191883e76cfc4..d948a0ad8b1926b5e86feb2d31fb9387c742ac34 100644 (file)
@@ -23,6 +23,13 @@ struct index_notify_io {
        struct io *io;
 };
 
+static void notify_delay_callback(struct index_mailbox *ibox)
+{
+       if (ibox->notify_delay_to != NULL)
+               timeout_remove(&ibox->notify_delay_to);
+       ibox->box.notify_callback(&ibox->box, ibox->box.notify_context);
+}
+
 static void check_timeout(struct index_mailbox *ibox)
 {
        struct index_notify_file *file;
@@ -37,16 +44,8 @@ static void check_timeout(struct index_mailbox *ibox)
                }
        }
 
-       if (notify) {
-               if (ibox->notify_delay_to != NULL)
-                       timeout_remove(&ibox->notify_delay_to);
-               ibox->box.notify_callback(&ibox->box, ibox->box.notify_context);
-       }
-}
-
-static void notify_delay_callback(struct index_mailbox *ibox)
-{
-       ibox->box.notify_callback(&ibox->box, ibox->box.notify_context);
+       if (notify)
+               notify_delay_callback(ibox);
 }
 
 static void notify_callback(struct index_mailbox *ibox)