mirror of
https://github.com/actions/toolkit.git
synced 2026-08-15 00:00:25 +02:00
Refactor saveCacheV2 to use saveCache from cacheHttpClient
This commit is contained in:
+6
-4
@@ -6,16 +6,18 @@ import {
|
||||
BlockBlobParallelUploadOptions
|
||||
} from '@azure/storage-blob'
|
||||
import {InvalidResponseError} from './shared/errors'
|
||||
import {UploadOptions} from '../options'
|
||||
|
||||
export async function uploadCacheArchiveSDK(
|
||||
signedUploadURL: string,
|
||||
archivePath: string
|
||||
archivePath: string,
|
||||
options?: UploadOptions
|
||||
): Promise<BlobUploadCommonResponse> {
|
||||
// Specify data transfer options
|
||||
const uploadOptions: BlockBlobParallelUploadOptions = {
|
||||
blockSize: 4 * 1024 * 1024, // 4 MiB max block size
|
||||
concurrency: 4, // maximum number of parallel transfer workers
|
||||
maxSingleShotSize: 8 * 1024 * 1024 // 8 MiB initial transfer size
|
||||
blockSize: options?.uploadChunkSize,
|
||||
concurrency: options?.uploadConcurrency, // maximum number of parallel transfer workers
|
||||
maxSingleShotSize: 128 * 1024 * 1024 // 128 MiB initial transfer size
|
||||
}
|
||||
|
||||
const blobClient: BlobClient = new BlobClient(signedUploadURL)
|
||||
|
||||
Reference in New Issue
Block a user