From 92210a9097d235e75f7f007b412553713d25f942 Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Wed, 12 Mar 2014 17:14:00 -0400 Subject: [PATCH] Only set most recent state Before, it would delve back to set state if recent entries indicated to not assert the tracked states. Correct that behavior so only last entry counts. --- confluent/log.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/confluent/log.py b/confluent/log.py index 1601f683..fddbad14 100644 --- a/confluent/log.py +++ b/confluent/log.py @@ -155,7 +155,7 @@ class Logger(object): binidx = binfile.tell() - 16 currsize = 0 offsets = collections.deque() - termstate = 0 + termstate = None while binidx > 0 and currsize < size: binfile.seek(binidx, 0) binidx -= 16 @@ -168,7 +168,8 @@ class Logger(object): continue currsize += datalen offsets.append((offset, datalen)) - termstate = termstate | eventaux + if termstate is None: + termstate = termstate | eventaux fcntl.flock(binfile, fcntl.LOCK_UN) binfile.close() textdata = ''