mirror of
https://github.com/actions/cache.git
synced 2025-04-21 11:36:45 +00:00
Separate out reserve call
This commit is contained in:
parent
7f6523f535
commit
436418ea07
2 changed files with 37 additions and 32 deletions
|
@ -35,6 +35,12 @@ async function run(): Promise<void> {
|
|||
return;
|
||||
}
|
||||
|
||||
const cacheId = await cacheHttpClient.reserveCache(primaryKey);
|
||||
if (cacheId < 0) {
|
||||
core.info(`Unable to reserve cache with key ${primaryKey}, another job may be creating this cache.`);
|
||||
return;
|
||||
}
|
||||
|
||||
const cachePath = utils.resolvePath(
|
||||
core.getInput(Inputs.Path, { required: true })
|
||||
);
|
||||
|
@ -77,7 +83,7 @@ async function run(): Promise<void> {
|
|||
return;
|
||||
}
|
||||
|
||||
await cacheHttpClient.saveCache(primaryKey, archivePath);
|
||||
await cacheHttpClient.saveCache(cacheId, archivePath);
|
||||
} catch (error) {
|
||||
utils.logWarning(error.message);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue