mirror of
https://git.mirrors.martin98.com/https://github.com/actions/toolkit
synced 2026-04-21 06:18:05 +08:00
Update with reviewer feedback
This commit is contained in:
14
packages/cache/src/internal/downloadUtils.ts
vendored
14
packages/cache/src/internal/downloadUtils.ts
vendored
@@ -120,12 +120,12 @@ export class DownloadProgress {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Callback used to update the progress.
|
* Returns a function used to handle TransferProgressEvents.
|
||||||
*
|
|
||||||
* @param progress the progress event
|
|
||||||
*/
|
*/
|
||||||
onProgressCallback(progress: TransferProgressEvent): void {
|
onProgress(): (progress: TransferProgressEvent) => void {
|
||||||
this.setReceivedBytes(progress.loadedBytes)
|
return (progress: TransferProgressEvent) => {
|
||||||
|
this.setReceivedBytes(progress.loadedBytes)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -261,9 +261,7 @@ export async function downloadCacheStorageSDK(
|
|||||||
segmentSize,
|
segmentSize,
|
||||||
{
|
{
|
||||||
concurrency: options.downloadConcurrency,
|
concurrency: options.downloadConcurrency,
|
||||||
onProgress: downloadProgress.onProgressCallback.bind(
|
onProgress: downloadProgress.onProgress()
|
||||||
downloadProgress
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user