fix 日志首次读取部分数据
This commit is contained in:
parent
f460e9a3f1
commit
e76606823f
@ -110,8 +110,11 @@ def get_logging(token: str):
|
||||
)
|
||||
|
||||
def log_generator():
|
||||
log_path = settings.LOG_PATH / 'moviepilot.log'
|
||||
texts = tailer.tail(open(log_path, 'r'), 50)
|
||||
while True:
|
||||
for text in tailer.follow(open(settings.LOG_PATH / 'moviepilot.log')):
|
||||
yield 'data: %s\n\n' % '\n'.join(texts)
|
||||
for text in tailer.follow(open(log_path, 'r')):
|
||||
yield 'data: %s\n\n' % (text or '')
|
||||
time.sleep(1)
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user