Refactor saveCacheV2 to use saveCache from cacheHttpClient

This commit is contained in:
Bassem Dghaidi
2024-11-28 07:22:01 -08:00
committed by GitHub
parent eaf0083ee2
commit 62f5f1885b
7 changed files with 158 additions and 116 deletions
+6 -4
View File
@@ -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)