Defer abandoned log scrubbing past launch

This commit is contained in:
wallentx committed 2026-10-18 03:56:09 -05:00
1 parent 66f5d39bab
commit 4ab4a86507
2 files changed
+32 -2

No files matched your search

@@ -342,6 +342,7 @@ object SessionArtifacts {
for (dir in abandoned) {
if (stopWhenSessionStarts && SessionState.running) break
if (dir == current) continue
if (beforeGuestStart && dir != latestPreviousSession) continue
val newest = dir == latestPreviousSession
try {
val recoveryNote = File(dir, "ended-without-teardown.txt")
@@ -415,6 +416,7 @@ object SessionArtifacts {
break
}
SessionEvents.record("session.artifacts_recovered", mapOf("newest" to newest), dir)
if (beforeGuestStart) return
val scrubbed = scrubTree(record) { stopWhenSessionStarts && SessionState.running }
val marked = markScrubbed(scrubbed)
if (scrubbed.deferred) break