From: Timo Sirainen Date: Mon, 9 Nov 2009 20:12:01 +0000 (-0500) Subject: IDLE: After seeing a change, don't check for more changes every 0,5 seconds. X-Git-Tag: 2.0.alpha3~15 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=7e35d10468f4243aa57d3fc77ff78dbcebffa8b3;p=thirdparty%2Fdovecot%2Fcore.git IDLE: After seeing a change, don't check for more changes every 0,5 seconds. --HG-- branch : HEAD --- diff --git a/src/lib-storage/index/index-mailbox-check.c b/src/lib-storage/index/index-mailbox-check.c index 624f3147e3..d948a0ad8b 100644 --- a/src/lib-storage/index/index-mailbox-check.c +++ b/src/lib-storage/index/index-mailbox-check.c @@ -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)