fix 日志首次读取部分数据
This commit is contained in:
parent
e76606823f
commit
5da3406647
@ -112,8 +112,8 @@ def get_logging(token: str):
|
||||
def log_generator():
|
||||
log_path = settings.LOG_PATH / 'moviepilot.log'
|
||||
texts = tailer.tail(open(log_path, 'r'), 50)
|
||||
yield 'data: %s\n\n' % '\n'.join(texts)
|
||||
while True:
|
||||
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