# HG changeset patch # User Timo Sirainen # Date 1268068614 -7200 # Node ID affad804356eba852db628d3026b9fd9f06ef094 # Parent 6794893d03c9d35795e7c498308de2041d9e8d05 IDLE: After a change, mailbox changes were being re-checked every 0.5 seconds. diff -r 6794893d03c9 -r affad804356e src/lib-storage/index/index-mailbox-check.c --- a/src/lib-storage/index/index-mailbox-check.c Mon Mar 08 19:07:06 2010 +0200 +++ b/src/lib-storage/index/index-mailbox-check.c Mon Mar 08 19:16:54 2010 +0200 @@ -23,6 +23,13 @@ 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 @@ } } - 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)