mirror of https://github.com/actions/toolkit
pull/1712/head
parent
fa9db3c8fa
commit
222733049e
|
@ -27,8 +27,13 @@ export async function uploadZipToBlobStorage(
|
||||||
let lastProgressTime = Date.now()
|
let lastProgressTime = Date.now()
|
||||||
let timeoutId: NodeJS.Timeout | undefined
|
let timeoutId: NodeJS.Timeout | undefined
|
||||||
|
|
||||||
const chunkTimer = (timeout: number): NodeJS.Timeout =>
|
const chunkTimer = (timeout: number): NodeJS.Timeout => {
|
||||||
setTimeout(() => {
|
// clear the previous timeout
|
||||||
|
if (timeoutId) {
|
||||||
|
clearTimeout(timeoutId)
|
||||||
|
}
|
||||||
|
|
||||||
|
timeoutId = setTimeout(() => {
|
||||||
const now = Date.now()
|
const now = Date.now()
|
||||||
// if there's been more than 30 seconds since the
|
// if there's been more than 30 seconds since the
|
||||||
// last progress event, then we'll consider the upload stalled
|
// last progress event, then we'll consider the upload stalled
|
||||||
|
@ -36,6 +41,8 @@ export async function uploadZipToBlobStorage(
|
||||||
throw new Error('Upload progress stalled.')
|
throw new Error('Upload progress stalled.')
|
||||||
}
|
}
|
||||||
}, timeout)
|
}, timeout)
|
||||||
|
return timeoutId
|
||||||
|
}
|
||||||
const maxConcurrency = getConcurrency()
|
const maxConcurrency = getConcurrency()
|
||||||
const bufferSize = getUploadChunkSize()
|
const bufferSize = getUploadChunkSize()
|
||||||
const blobClient = new BlobClient(authenticatedUploadURL)
|
const blobClient = new BlobClient(authenticatedUploadURL)
|
||||||
|
|
Loading…
Reference in New Issue