mirror of
https://github.com/gradle/gradle-build-action.git
synced 2025-07-06 23:35:59 +02:00
Improve cache-reporting when entry already exists
This commit is contained in:
parent
a23ac1d61c
commit
0a5ede19a9
4 changed files with 34 additions and 23 deletions
|
@ -118,12 +118,9 @@ abstract class AbstractEntryExtractor {
|
|||
pattern: string,
|
||||
listener: CacheEntryListener
|
||||
): Promise<ExtractedCacheEntry> {
|
||||
listener.markRequested(cacheKey)
|
||||
|
||||
const restoredEntry = await restoreCache([pattern], cacheKey)
|
||||
const restoredEntry = await restoreCache([pattern], cacheKey, [], listener)
|
||||
if (restoredEntry) {
|
||||
core.info(`Restored ${artifactType} with key ${cacheKey} to ${pattern}`)
|
||||
listener.markRestored(restoredEntry.key, restoredEntry.size)
|
||||
return new ExtractedCacheEntry(artifactType, pattern, cacheKey)
|
||||
} else {
|
||||
core.info(`Did not restore ${artifactType} with key ${cacheKey} to ${pattern}`)
|
||||
|
@ -217,10 +214,7 @@ abstract class AbstractEntryExtractor {
|
|||
cacheDebug(`No change to previously restored ${artifactType}. Not saving.`)
|
||||
} else {
|
||||
core.info(`Caching ${artifactType} with path '${pattern}' and cache key: ${cacheKey}`)
|
||||
const savedEntry = await saveCache([pattern], cacheKey)
|
||||
if (savedEntry !== undefined) {
|
||||
entryListener.markSaved(savedEntry.key, savedEntry.size)
|
||||
}
|
||||
await saveCache([pattern], cacheKey, entryListener)
|
||||
}
|
||||
|
||||
for (const file of matchingFiles) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue