mirror of
https://github.com/moonrepo/setup-rust.git
synced 2025-04-29 13:30:03 +00:00
Merge 3a265b5c1d
into 52e0bc3392
This commit is contained in:
commit
c96fe35ebb
1 changed files with 13 additions and 2 deletions
15
src/cargo.ts
15
src/cargo.ts
|
@ -195,8 +195,19 @@ export async function saveCache() {
|
||||||
for (const cachePath of cachePaths) {
|
for (const cachePath of cachePaths) {
|
||||||
core.debug(`- ${cachePath}`);
|
core.debug(`- ${cachePath}`);
|
||||||
}
|
}
|
||||||
|
for (let i = 1; i <= 10; i++) {
|
||||||
await cache.saveCache(cachePaths, primaryKey);
|
try {
|
||||||
|
return await cache.saveCache(cachePaths, primaryKey);
|
||||||
|
}
|
||||||
|
catch(error) {
|
||||||
|
const errStr = `${error}`
|
||||||
|
if (errStr.includes("Cache service responded with 429 during upload chunk")) {
|
||||||
|
core.info('Failed to upload cache, got rate limit error, waiting 30 seconds.');
|
||||||
|
await new Promise(f => setTimeout(f, 30000));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
throw Error("Failed to upload cache.")
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function restoreCache() {
|
export async function restoreCache() {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue