dovecot-2.1: replicator: Fixed off-by-one-second "do we do a ful...

dovecot at dovecot.org dovecot at dovecot.org
Thu Mar 15 18:24:28 EET 2012


details:   http://hg.dovecot.org/dovecot-2.1/rev/e935ddb5a9fc
changeset: 14318:e935ddb5a9fc
user:      Timo Sirainen <tss at iki.fi>
date:      Thu Mar 15 18:24:11 2012 +0200
description:
replicator: Fixed off-by-one-second "do we do a full sync now?" check.

diffstat:

 src/replication/replicator/replicator-brain.c |  6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diffs (22 lines):

diff -r 914076de4c48 -r e935ddb5a9fc src/replication/replicator/replicator-brain.c
--- a/src/replication/replicator/replicator-brain.c	Thu Mar 15 16:42:22 2012 +0200
+++ b/src/replication/replicator/replicator-brain.c	Thu Mar 15 18:24:11 2012 +0200
@@ -103,14 +103,16 @@
 {
 	struct replicator_sync_context *ctx;
 	struct doveadm_connection *conn;
+	time_t next_full_sync;
 	bool full;
 
 	conn = get_doveadm_connection(brain);
 	if (conn == NULL)
 		return FALSE;
 
-	full = user->last_full_sync +
-		brain->set->replication_full_sync_interval < ioloop_time;
+	next_full_sync = user->last_full_sync +
+		brain->set->replication_full_sync_interval;
+	full = next_full_sync <= ioloop_time;
 	/* update the sync times immediately. if the replication fails we still
 	   wouldn't want it to be retried immediately. */
 	user->last_fast_sync = ioloop_time;


More information about the dovecot-cvs mailing list