(options: PruneOptions = {})
| 28 | } |
| 29 | |
| 30 | async function pruneLogDirectory(options: PruneOptions = {}): Promise<{ |
| 31 | logDir: string; |
| 32 | scanned: number; |
| 33 | deleted: number; |
| 34 | skippedByCooldown: boolean; |
| 35 | skippedByLock: boolean; |
| 36 | }> { |
| 37 | const sweepOptions: WorkspaceFilesystemLifecycleOptions = { |
| 38 | trigger: 'manual', |
| 39 | logDir: options.logDir, |
| 40 | markerPath: options.markerPath, |
| 41 | lockDir: options.lockDir, |
| 42 | now: options.now, |
| 43 | maxAgeMs: options.maxAgeMs, |
| 44 | maxFiles: options.maxFiles, |
| 45 | cooldownMs: options.cooldownMs, |
| 46 | force: options.force, |
| 47 | minVisibleMs: options.activeGraceMs, |
| 48 | protectedLogPaths: options.protectedLogPaths, |
| 49 | lockPurpose: 'log-retention', |
| 50 | }; |
| 51 | const result = await runWorkspaceFilesystemLifecycleSweep(sweepOptions); |
| 52 | return { |
| 53 | logDir: result.logDir, |
| 54 | scanned: result.scanned, |
| 55 | deleted: result.deleted, |
| 56 | skippedByCooldown: result.skippedByCooldown, |
| 57 | skippedByLock: result.skippedByLock, |
| 58 | }; |
| 59 | } |
| 60 | |
| 61 | let logDir: string; |
| 62 |
no test coverage detected