Skip to content

Commit bcbb0e2

Browse files
committed
Fix older-than filter to use descendant mtime instead of directory mtime
When checking if a directory should be purged based on --older-than, the retention filter now uses only the newest descendant file mtime, ignoring the directory's own metadata timestamp. This prevents directories with stale contents but recently updated metadata from being incorrectly skipped during purge operations.
1 parent 7311ae8 commit bcbb0e2

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

src/utils/purge-storage/planning.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,8 +130,7 @@ async function candidateFromPath(params: {
130130
}
131131

132132
const scan = await scanPath(params.candidatePath);
133-
const effectiveMtimeMs =
134-
scan.latestMtimeMs === null ? stat.mtimeMs : Math.max(stat.mtimeMs, scan.latestMtimeMs);
133+
const effectiveMtimeMs = scan.latestMtimeMs ?? stat.mtimeMs;
135134

136135
const retentionReason = shouldKeepForRetention({
137136
mtimeMs: effectiveMtimeMs,

0 commit comments

Comments
 (0)