try seek
This commit is contained in:
1 parent
9a4a39c71b
commit
191fbbfe18
1 file changed
+4
@@ -418,6 +418,10 @@ class Backend:
|
|||||||
async def tail_log():
|
async def tail_log():
|
||||||
log.debug(f"tailing file: {self.model_log_file}")
|
log.debug(f"tailing file: {self.model_log_file}")
|
||||||
async with await open_file(self.model_log_file, mode="r", encoding='utf-8', errors='ignore') as f:
|
async with await open_file(self.model_log_file, mode="r", encoding='utf-8', errors='ignore') as f:
|
||||||
|
try:
|
||||||
|
f.seek(0)
|
||||||
|
except:
|
||||||
|
pass
|
||||||
while True:
|
while True:
|
||||||
line = await f.readline()
|
line = await f.readline()
|
||||||
if line:
|
if line:
|
||||||
|
|||||||
Reference in new issue
Block a user