dovecot-2.2: stats: Forced sending of UPDATE-SESSION every 5 min...

dovecot at dovecot.org dovecot at dovecot.org
Wed Nov 18 17:16:06 UTC 2015


details:   http://hg.dovecot.org/dovecot-2.2/rev/dc08ba342085
changeset: 19395:dc08ba342085
user:      Timo Sirainen <tss at iki.fi>
date:      Wed Nov 18 19:15:36 2015 +0200
description:
stats: Forced sending of UPDATE-SESSION every 5 minutes wasn't working.
This caused stats process to forget about idling (imap) sessions if they
didn't do anything for over 15 minutes.

diffstat:

 src/plugins/stats/stats-plugin.c |  15 ++++++---------
 1 files changed, 6 insertions(+), 9 deletions(-)

diffs (32 lines):

diff -r 109c23a7412a -r dc08ba342085 src/plugins/stats/stats-plugin.c
--- a/src/plugins/stats/stats-plugin.c	Wed Nov 18 18:54:51 2015 +0200
+++ b/src/plugins/stats/stats-plugin.c	Wed Nov 18 19:15:36 2015 +0200
@@ -103,22 +103,19 @@
 	}
 	*changed_r = FALSE;
 
+	diff = now - suser->last_session_update;
+	if (diff >= SESSION_STATS_FORCE_REFRESH_SECS)
+		return TRUE;
+	*to_next_secs_r = SESSION_STATS_FORCE_REFRESH_SECS - diff;
+
 	if (!suser->session_sent_duplicate) {
 		if (suser->last_session_update != now) {
 			/* send one duplicate notification so stats reader
 			   knows that this session is idle now */
 			return TRUE;
 		}
-		*to_next_secs_r = 1;
-		return FALSE;
 	}
-
-	diff = now - suser->last_session_update;
-	if (diff < SESSION_STATS_FORCE_REFRESH_SECS) {
-		*to_next_secs_r = SESSION_STATS_FORCE_REFRESH_SECS - diff;
-		return FALSE;
-	}
-	return TRUE;
+	return FALSE;
 }
 
 static void session_stats_refresh(struct mail_user *user)


More information about the dovecot-cvs mailing list