Skip to content

Commit

Permalink
fix 日志首次读取部分数据
Browse files Browse the repository at this point in the history
  • Loading branch information
jxxghp committed Aug 14, 2023
1 parent e766068 commit 5da3406
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/api/endpoints/system.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 5da3406

Please sign in to comment.