mirror of
https://github.com/xcat2/confluent.git
synced 2025-08-29 14:28:18 +00:00
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.
This commit is contained in:
@@ -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)
|
||||
|
Reference in New Issue
Block a user