fix(L4): preserve raw sessions skipped as recent(<2h) (#90)

compress_session.py Phase 4 builds to_del from both processed files
and every skipped file. Phase 1 marks files younger than 2h as
'recent(<2h)' (line 175) so their still-active writer is not
interrupted, but Phase 4 then deletes them anyway.

Filter the skipped-loop by reason so 'recent' files are preserved.
Processed files and other skip reasons (dup, compression error)
still proceed through deletion as before.
This commit is contained in:
Junghwan
2026-04-17 18:35:50 +09:00
committed by GitHub
parent 0e3e602121
commit adcfb8f730

View File

@@ -219,7 +219,8 @@ def batch_process(src, l4_dir=None, dry_run=True):
# Phase 4: Delete raw files
to_del = [rp for *_, rp in results]
for fname, _ in skipped:
for fname, reason in skipped:
if 'recent' in reason: continue # active session still being written
m = [f for f in raw_files if os.path.basename(f) == fname]
if m: to_del.append(m[0])
deleted = 0