From 7e35d10468f4243aa57d3fc77ff78dbcebffa8b3 Mon Sep 17 00:00:00 2001 From: Timo Sirainen Date: Mon, 9 Nov 2009 15:12:01 -0500 Subject: [PATCH] IDLE: After seeing a change, don't check for more changes every 0,5 seconds. --HG-- branch : HEAD --- src/lib-storage/index/index-mailbox-check.c | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) 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) -- 2.47.3