Formatting and stylistic cleanup
This commit is contained in:
+10
-5
@@ -3,15 +3,15 @@ import * as core from '@actions/core'
|
||||
import {
|
||||
BlobClient,
|
||||
BlockBlobClient,
|
||||
BlobDownloadOptions,
|
||||
BlobDownloadOptions
|
||||
} from '@azure/storage-blob'
|
||||
|
||||
export async function DownloadCacheFile(
|
||||
signedUploadURL: string,
|
||||
archivePath: string,
|
||||
archivePath: string
|
||||
): Promise<{}> {
|
||||
const downloadOptions: BlobDownloadOptions = {
|
||||
maxRetryRequests: 5,
|
||||
maxRetryRequests: 5
|
||||
}
|
||||
|
||||
// TODO: tighten the configuration and pass the appropriate user-agent
|
||||
@@ -21,5 +21,10 @@ export async function DownloadCacheFile(
|
||||
core.debug(`BlobClient: ${JSON.stringify(blobClient)}`)
|
||||
core.debug(`blockBlobClient: ${JSON.stringify(blockBlobClient)}`)
|
||||
|
||||
return blockBlobClient.downloadToFile(archivePath, 0, undefined, downloadOptions)
|
||||
}
|
||||
return blockBlobClient.downloadToFile(
|
||||
archivePath,
|
||||
0,
|
||||
undefined,
|
||||
downloadOptions
|
||||
)
|
||||
}
|
||||
|
||||
+5
-5
@@ -7,15 +7,15 @@ import {
|
||||
|
||||
export async function UploadCacheFile(
|
||||
signedUploadURL: string,
|
||||
archivePath: string,
|
||||
archivePath: string
|
||||
): Promise<{}> {
|
||||
// TODO: tighten the configuration and pass the appropriate user-agent
|
||||
// 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
|
||||
};
|
||||
maxSingleShotSize: 8 * 1024 * 1024 // 8 MiB initial transfer size
|
||||
}
|
||||
|
||||
const blobClient: BlobClient = new BlobClient(signedUploadURL)
|
||||
const blockBlobClient: BlockBlobClient = blobClient.getBlockBlobClient()
|
||||
@@ -23,5 +23,5 @@ export async function UploadCacheFile(
|
||||
core.debug(`BlobClient: ${JSON.stringify(blobClient)}`)
|
||||
core.debug(`blockBlobClient: ${JSON.stringify(blockBlobClient)}`)
|
||||
|
||||
return blockBlobClient.uploadFile(archivePath, uploadOptions);
|
||||
}
|
||||
return blockBlobClient.uploadFile(archivePath, uploadOptions)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user