Try to slow down upload cache
This commit is contained in:
parent
0753213107
commit
74154140df
8 changed files with 473 additions and 218 deletions
9
index.js
9
index.js
|
|
@ -1,4 +1,5 @@
|
|||
const fs = require('fs')
|
||||
const { setTimeout } = require('node:timers/promises')
|
||||
const core = require('@actions/core')
|
||||
const cache = require('@actions/cache')
|
||||
const github = require('@actions/github')
|
||||
|
|
@ -88,7 +89,13 @@ async function restoreCache (cacheConfig) {
|
|||
|
||||
console.log(`Attempting to restore ${name} cache from ${key}`)
|
||||
|
||||
const restoredKey = await cache.restoreCache(paths, key, [restoreKey])
|
||||
const restoredKey = await setTimeout(1000, async function() {
|
||||
return await cache.restoreCache(
|
||||
paths, key, [restoreKey],
|
||||
{ segmentTimeoutInMs: 300000 } // 5 minutes
|
||||
)
|
||||
}())
|
||||
|
||||
if (restoredKey) {
|
||||
console.log(`Successfully restored cache from ${restoredKey}`)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue