Fix another file handle seeking cornercase
continuous-integration/drone Build is passing
Details
continuous-integration/drone Build is passing
Details
This commit is contained in:
parent
3cf2ea9e28
commit
1e3f16ca02
|
@ -258,7 +258,6 @@ class LogFile(object):
|
||||||
self.loop.create_task(self.handler_loop())
|
self.loop.create_task(self.handler_loop())
|
||||||
|
|
||||||
def poke(self):
|
def poke(self):
|
||||||
self.tail = self.fh.seek(0, os.SEEK_END)
|
|
||||||
self.more_content.set()
|
self.more_content.set()
|
||||||
|
|
||||||
def close(self):
|
def close(self):
|
||||||
|
@ -291,9 +290,12 @@ class LogFile(object):
|
||||||
break
|
break
|
||||||
await self.more_content.wait()
|
await self.more_content.wait()
|
||||||
self.more_content.clear()
|
self.more_content.clear()
|
||||||
|
self.tail = self.fh.seek(0, os.SEEK_END)
|
||||||
|
|
||||||
assert self.head < self.tail
|
assert self.head < self.tail
|
||||||
self.fh.seek(self.head)
|
self.fh.seek(self.head)
|
||||||
buf = self.fh.readline()
|
buf = self.fh.readline()
|
||||||
|
self.head += len(buf)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
reason = "unicode-encoding"
|
reason = "unicode-encoding"
|
||||||
|
@ -314,7 +316,7 @@ class LogFile(object):
|
||||||
break
|
break
|
||||||
|
|
||||||
histogram_line_size.observe(len(buf))
|
histogram_line_size.observe(len(buf))
|
||||||
self.head += len(buf)
|
|
||||||
record_size += len(buf)
|
record_size += len(buf)
|
||||||
|
|
||||||
if record_size < args.max_record_size:
|
if record_size < args.max_record_size:
|
||||||
|
|
Loading…
Reference in New Issue