Skip to content

Commit

Permalink
Improve log message when there's nothing to clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
Henry Mercer committed May 23, 2024
1 parent f7f7192 commit fdba1f9
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
6 changes: 5 additions & 1 deletion lib/trap-caching.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion lib/trap-caching.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 7 additions & 1 deletion src/trap-caching.ts
Original file line number Diff line number Diff line change
Expand Up @@ -206,8 +206,14 @@ export async function cleanupTrapCaches(
logger.debug(
`Keeping most recent TRAP cache (${JSON.stringify(mostRecentCache)})`,
);

if (cachesToRemove.length === 0) {
logger.info(`No TRAP caches to clean up for ${language}.`);
continue;
}

for (const cache of cachesToRemove) {
logger.debug(`Deleting old TRAP cache (${JSON.stringify(cache)})`);
logger.debug(`Cleaning up TRAP cache (${JSON.stringify(cache)})`);
await apiClient.deleteActionsCache(cache.id);
}
const bytesCleanedUp = cachesToRemove.reduce(
Expand Down

0 comments on commit fdba1f9

Please sign in to comment.