From 2742e837515917250947c6553b5d9a4d1deeb699 Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Wed, 12 Mar 2014 19:50:42 -0400 Subject: [PATCH] Fix order of text log reassembly The facility was incorrectly reassembling the text records in reverse order. With this change, the set buffer from log function seems to be working as intended. --- confluent/log.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/confluent/log.py b/confluent/log.py index fddbad14..7ffab148 100644 --- a/confluent/log.py +++ b/confluent/log.py @@ -154,7 +154,7 @@ class Logger(object): binfile.seek(0, 2) binidx = binfile.tell() - 16 currsize = 0 - offsets = collections.deque() + offsets = [] termstate = None while binidx > 0 and currsize < size: binfile.seek(binidx, 0) @@ -169,13 +169,13 @@ class Logger(object): currsize += datalen offsets.append((offset, datalen)) if termstate is None: - termstate = termstate | eventaux + termstate = eventaux fcntl.flock(binfile, fcntl.LOCK_UN) binfile.close() textdata = '' fcntl.flock(textfile, fcntl.LOCK_SH) while offsets: - (offset, len) = offsets.popleft() + (offset, len) = offsets.pop() textfile.seek(offset, 0) textdata += textfile.read(len) fcntl.flock(textfile, fcntl.LOCK_UN)