diff --git a/app/api/endpoints/system.py b/app/api/endpoints/system.py index f722f37e3..4272ee51e 100644 --- a/app/api/endpoints/system.py +++ b/app/api/endpoints/system.py @@ -111,8 +111,10 @@ 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) + # 读取文件末尾50行,不使用tailer模块 + with open(log_path, 'r') as f: + for line in f.readlines()[-50:]: + yield 'data: %s\n\n' % line while True: for text in tailer.follow(open(log_path, 'r')): yield 'data: %s\n\n' % (text or '') diff --git a/app/helper/torrent.py b/app/helper/torrent.py index 993a6bdfd..8cecdeb18 100644 --- a/app/helper/torrent.py +++ b/app/helper/torrent.py @@ -144,7 +144,7 @@ def get_torrent_info(torrent_path: Path) -> Tuple[str, List[str]]: file_list = [torrentinfo.name] else: file_list = [fileinfo.name for fileinfo in torrentinfo.files] - logger.info(f"{torrent_path.stem} -> 目录:{folder_name},文件清单:{file_list}") + logger.debug(f"{torrent_path.stem} -> 目录:{folder_name},文件清单:{file_list}") return folder_name, file_list except Exception as err: logger.error(f"种子文件解析失败:{err}")