Skip to content

Commit 9e33c13

Browse files
committed
Add detailed debug logging for cache cleanup
1 parent 64ed4c0 commit 9e33c13

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

scripts/generate-md-exports.mjs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -219,12 +219,21 @@ async function createWork() {
219219
console.log(` - Files tracked as used: ${globalUsedCacheFiles.size}`);
220220
console.log(` - Files to delete: ${filesToDelete.length}`);
221221

222+
// Debug: Show a few examples of what we're comparing
223+
console.log(` - Example used files: ${Array.from(globalUsedCacheFiles).slice(0, 3).join(', ')}`);
224+
console.log(` - Example dir files: ${allFiles.slice(0, 3).join(', ')}`);
225+
console.log(` - Example to delete: ${filesToDelete.slice(0, 3).join(', ')}`);
226+
222227
if (filesToDelete.length > 0) {
223228
await Promise.all(
224229
filesToDelete.map(file => rm(path.join(CACHE_DIR, file), {force: true}))
225230
);
226231
console.log(`🧹 Cleaned up ${filesToDelete.length} unused cache files`);
227232
}
233+
234+
// Verify cleanup worked
235+
const remainingFiles = await readdir(CACHE_DIR);
236+
console.log(`✅ Cache directory now has ${remainingFiles.length} files`);
228237
} catch (err) {
229238
console.warn('Failed to clean unused cache files:', err);
230239
}

0 commit comments

Comments
 (0)