Skip to content

Commit fdba1f9

Browse files
committed
Improve log message when there's nothing to clean up
1 parent f7f7192 commit fdba1f9

File tree

3 files changed

+13
-3
lines changed

3 files changed

+13
-3
lines changed

lib/trap-caching.js

Lines changed: 5 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/trap-caching.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/trap-caching.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,8 +206,14 @@ export async function cleanupTrapCaches(
206206
logger.debug(
207207
`Keeping most recent TRAP cache (${JSON.stringify(mostRecentCache)})`,
208208
);
209+
210+
if (cachesToRemove.length === 0) {
211+
logger.info(`No TRAP caches to clean up for ${language}.`);
212+
continue;
213+
}
214+
209215
for (const cache of cachesToRemove) {
210-
logger.debug(`Deleting old TRAP cache (${JSON.stringify(cache)})`);
216+
logger.debug(`Cleaning up TRAP cache (${JSON.stringify(cache)})`);
211217
await apiClient.deleteActionsCache(cache.id);
212218
}
213219
const bytesCleanedUp = cachesToRemove.reduce(

0 commit comments

Comments
 (0)