fix(gsd): handle retentionDays=0 on Windows + run windows-portability on PRs (#2460)
Two changes: 1. pruneActivityLogs: when retentionDays is 0, skip mtime comparison and unconditionally remove all files except highest-seq. On Windows, NTFS timestamp resolution meant freshly-created files could have mtime >= Date.now() at cutoff calculation, so none were pruned. 2. CI: remove the push-to-main gate on windows-portability so it runs on PRs too — catches Windows failures before merge instead of after. Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
f4ecf9d11a
commit
e2eb5cecf2
2 changed files with 2 additions and 2 deletions
3
.github/workflows/ci.yml
vendored
3
.github/workflows/ci.yml
vendored
|
|
@ -145,8 +145,7 @@ jobs:
|
|||
timeout-minutes: 15
|
||||
needs: detect-changes
|
||||
if: >-
|
||||
needs.detect-changes.outputs.docs-only != 'true' &&
|
||||
github.event_name == 'push' && github.ref == 'refs/heads/main'
|
||||
needs.detect-changes.outputs.docs-only != 'true'
|
||||
runs-on: blacksmith-4vcpu-windows-2025
|
||||
|
||||
steps:
|
||||
|
|
|
|||
|
|
@ -153,6 +153,7 @@ export function pruneActivityLogs(activityDir: string, retentionDays: number): v
|
|||
const cutoff = Date.now() - retentionDays * 86_400_000;
|
||||
for (const entry of entries) {
|
||||
if (entry.seq === maxSeq) continue; // always preserve highest-seq
|
||||
if (retentionDays === 0) { try { unlinkSync(entry.filePath); } catch { /* skip */ } continue; }
|
||||
try {
|
||||
const mtime = statSync(entry.filePath).mtimeMs;
|
||||
if (Math.floor(mtime) <= cutoff) unlinkSync(entry.filePath);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue