修复:独立回收中断备份并限制 AI 日志增长

This commit is contained in:
2026-11-10 16:02:46 +08:00
parent dc5b9b76ec
commit cc8832c8e5
15 changed files with 584 additions and 39 deletions
+11 -1
View File
@@ -16,7 +16,17 @@ MAX_AGE = 7 * 86400
def candidates(root, support):
root, support = Path(root).resolve(), Path(support).resolve()
paths = set()
for base, depth in ((root / 'output', 3), (root / '.runtime', 2), (support / 'logs', 1)):
native_logs = []
native = root / '.runtime/nao-users'
if native.is_dir() and not native.is_symlink():
for actor in native.iterdir():
if actor.is_symlink() or not actor.is_dir(): continue
native_logs.append((actor / 'logs', 1))
sessions = actor / 'sessions'
if sessions.is_dir() and not sessions.is_symlink():
native_logs.extend((session / 'logs', 1) for session in sessions.iterdir()
if session.is_dir() and not session.is_symlink())
for base, depth in ((root / 'output', 3), (root / '.runtime', 2), (support / 'logs', 1), *native_logs):
if not base.is_dir() or base.is_symlink():
continue
for directory, dirs, files in os.walk(base, followlinks=False):