Linter fixes

This commit is contained in:
Bassem Dghaidi
2024-11-28 03:53:34 -08:00
committed by GitHub
parent df166709a3
commit c1fb081674
3 changed files with 34 additions and 35 deletions
+12 -12
View File
@@ -3,18 +3,18 @@ import * as path from 'path'
import * as utils from './internal/cacheUtils'
import * as cacheHttpClient from './internal/cacheHttpClient'
import * as cacheTwirpClient from './internal/shared/cacheTwirpClient'
import { downloadCacheStorageSDK } from './internal/downloadUtils'
import { getCacheServiceVersion, isGhes } from './internal/config'
import { DownloadOptions, UploadOptions } from './options'
import { createTar, extractTar, listTar } from './internal/tar'
import {downloadCacheStorageSDK} from './internal/downloadUtils'
import {getCacheServiceVersion, isGhes} from './internal/config'
import {DownloadOptions, UploadOptions} from './options'
import {createTar, extractTar, listTar} from './internal/tar'
import {
CreateCacheEntryRequest,
FinalizeCacheEntryUploadRequest,
FinalizeCacheEntryUploadResponse,
GetCacheEntryDownloadURLRequest
} from './generated/results/api/v1/cache'
import { CacheFileSizeLimit } from './internal/constants'
import { uploadCacheArchiveSDK } from './internal/uploadUtils'
import {CacheFileSizeLimit} from './internal/constants'
import {uploadCacheArchiveSDK} from './internal/uploadUtils'
export class ValidationError extends Error {
constructor(message: string) {
super(message)
@@ -275,9 +275,9 @@ async function restoreCacheV2(
response.signedDownloadUrl,
archivePath,
options ||
({
timeoutInMs: 30000
} as DownloadOptions)
({
timeoutInMs: 30000
} as DownloadOptions)
)
const archiveFileSize = utils.getArchiveFileSizeInBytes(archivePath)
@@ -414,9 +414,9 @@ async function saveCacheV1(
} else if (reserveCacheResponse?.statusCode === 400) {
throw new Error(
reserveCacheResponse?.error?.message ??
`Cache size of ~${Math.round(
archiveFileSize / (1024 * 1024)
)} MB (${archiveFileSize} B) is over the data cap limit, not saving cache.`
`Cache size of ~${Math.round(
archiveFileSize / (1024 * 1024)
)} MB (${archiveFileSize} B) is over the data cap limit, not saving cache.`
)
} else {
throw new ReserveCacheError(
+5 -6
View File
@@ -5,13 +5,12 @@ import {
BlockBlobClient,
BlockBlobParallelUploadOptions
} from '@azure/storage-blob'
import { InvalidResponseError } from './shared/errors'
import {InvalidResponseError} from './shared/errors'
export async function uploadCacheArchiveSDK
(
signedUploadURL: string,
archivePath: string
): Promise<BlobUploadCommonResponse> {
export async function uploadCacheArchiveSDK(
signedUploadURL: string,
archivePath: string
): Promise<BlobUploadCommonResponse> {
// Specify data transfer options
const uploadOptions: BlockBlobParallelUploadOptions = {
blockSize: 4 * 1024 * 1024, // 4 MiB max block size