1
0
Fork 0

Implement cache v2

Link-/blobcache-spike
Bassem Dghaidi 2024-06-10 11:36:37 -07:00 committed by GitHub
parent dccc3f7f1c
commit 6635d12ce0
1 changed files with 4 additions and 2 deletions

View File

@ -6,7 +6,7 @@ export async function UploadCache(
uploadURL: GetCacheBlobUploadURLResponse, uploadURL: GetCacheBlobUploadURLResponse,
archivePath: string, archivePath: string,
): Promise<{}> { ): Promise<{}> {
core.debug(`Uploading cache to: ${uploadURL}`) core.info(`Uploading ${archivePath} to: ${uploadURL}`)
// Specify data transfer options // Specify data transfer options
const uploadOptions: BlockBlobParallelUploadOptions = { const uploadOptions: BlockBlobParallelUploadOptions = {
@ -15,10 +15,12 @@ export async function UploadCache(
maxSingleShotSize: 8 * 1024 * 1024, // 8 MiB initial transfer size maxSingleShotSize: 8 * 1024 * 1024, // 8 MiB initial transfer size
}; };
// Create blob client from container client
// const blobClient: BlobClient = new BlobClient(uploadURL.urls[0]) // const blobClient: BlobClient = new BlobClient(uploadURL.urls[0])
const blobClient: BlobClient = new BlobClient(uploadURL.urls[0].url) const blobClient: BlobClient = new BlobClient(uploadURL.urls[0].url)
const blockBlobClient: BlockBlobClient = blobClient.getBlockBlobClient() const blockBlobClient: BlockBlobClient = blobClient.getBlockBlobClient()
core.info(`BlobClient: ${blobClient}`)
core.info(`BlobClient: ${blockBlobClient}`)
return blockBlobClient.uploadFile(archivePath, uploadOptions); return blockBlobClient.uploadFile(archivePath, uploadOptions);
} }