Fix typo in function name (#590)

This commit is contained in:
Minh Nguyen
2021-05-03 18:09:44 +03:00
committed by GitHub
parent fbdf27470c
commit d972090333
7 changed files with 18 additions and 18 deletions

View File

@@ -104,7 +104,7 @@ export async function restoreCache(
await listTar(archivePath, compressionMethod)
}
const archiveFileSize = utils.getArchiveFileSizeIsBytes(archivePath)
const archiveFileSize = utils.getArchiveFileSizeInBytes(archivePath)
core.info(
`Cache Size: ~${Math.round(
archiveFileSize / (1024 * 1024)
@@ -172,7 +172,7 @@ export async function saveCache(
}
const fileSizeLimit = 5 * 1024 * 1024 * 1024 // 5GB per repo limit
const archiveFileSize = utils.getArchiveFileSizeIsBytes(archivePath)
const archiveFileSize = utils.getArchiveFileSizeInBytes(archivePath)
core.debug(`File Size: ${archiveFileSize}`)
if (archiveFileSize > fileSizeLimit) {
throw new Error(

View File

@@ -219,7 +219,7 @@ async function uploadFile(
options?: UploadOptions
): Promise<void> {
// Upload Chunks
const fileSize = fs.statSync(archivePath).size
const fileSize = utils.getArchiveFileSizeInBytes(archivePath)
const resourceUrl = getCacheApiUrl(`caches/${cacheId.toString()}`)
const fd = fs.openSync(archivePath, 'r')
const uploadOptions = getUploadOptions(options)
@@ -300,7 +300,7 @@ export async function saveCache(
// Commit Cache
core.debug('Commiting cache')
const cacheSize = utils.getArchiveFileSizeIsBytes(archivePath)
const cacheSize = utils.getArchiveFileSizeInBytes(archivePath)
core.info(
`Cache Size: ~${Math.round(cacheSize / (1024 * 1024))} MB (${cacheSize} B)`
)

View File

@@ -35,7 +35,7 @@ export async function createTempDirectory(): Promise<string> {
return dest
}
export function getArchiveFileSizeIsBytes(filePath: string): number {
export function getArchiveFileSizeInBytes(filePath: string): number {
return fs.statSync(filePath).size
}

View File

@@ -190,7 +190,7 @@ export async function downloadCacheHttpClient(
if (contentLengthHeader) {
const expectedLength = parseInt(contentLengthHeader)
const actualLength = utils.getArchiveFileSizeIsBytes(archivePath)
const actualLength = utils.getArchiveFileSizeInBytes(archivePath)
if (actualLength !== expectedLength) {
throw new Error(