mirror of
https://git.mirrors.martin98.com/https://github.com/actions/toolkit
synced 2026-04-07 04:23:41 +08:00
Refactor code formatting for consistency and readability
This commit is contained in:
15
packages/cache/src/internal/cacheHttpClient.ts
vendored
15
packages/cache/src/internal/cacheHttpClient.ts
vendored
@@ -1,12 +1,12 @@
|
||||
import * as core from '@actions/core'
|
||||
import { HttpClient } from '@actions/http-client'
|
||||
import { BearerCredentialHandler } from '@actions/http-client/lib/auth'
|
||||
import {HttpClient} from '@actions/http-client'
|
||||
import {BearerCredentialHandler} from '@actions/http-client/lib/auth'
|
||||
import {
|
||||
RequestOptions,
|
||||
TypedResponse
|
||||
} from '@actions/http-client/lib/interfaces'
|
||||
import * as fs from 'fs'
|
||||
import { URL } from 'url'
|
||||
import {URL} from 'url'
|
||||
import * as utils from './cacheUtils'
|
||||
import {
|
||||
ArtifactCacheEntry,
|
||||
@@ -33,8 +33,8 @@ import {
|
||||
retryHttpClientResponse,
|
||||
retryTypedResponse
|
||||
} from './requestUtils'
|
||||
import { getCacheServiceURL } from './config'
|
||||
import { getUserAgentString } from './shared/user-agent'
|
||||
import {getCacheServiceURL} from './config'
|
||||
import {getUserAgentString} from './shared/user-agent'
|
||||
|
||||
function getCacheApiUrl(resource: string): string {
|
||||
const baseUrl: string = getCacheServiceURL()
|
||||
@@ -217,7 +217,8 @@ async function uploadChunk(
|
||||
end: number
|
||||
): Promise<void> {
|
||||
core.debug(
|
||||
`Uploading chunk of size ${end - start + 1
|
||||
`Uploading chunk of size ${
|
||||
end - start + 1
|
||||
} bytes at offset ${start} with content range: ${getContentRange(
|
||||
start,
|
||||
end
|
||||
@@ -313,7 +314,7 @@ async function commitCache(
|
||||
cacheId: number,
|
||||
filesize: number
|
||||
): Promise<TypedResponse<null>> {
|
||||
const commitCacheRequest: CommitCacheRequest = { size: filesize }
|
||||
const commitCacheRequest: CommitCacheRequest = {size: filesize}
|
||||
return await retryTypedResponse('commitCache', async () =>
|
||||
httpClient.postJson<null>(
|
||||
getCacheApiUrl(`caches/${cacheId.toString()}`),
|
||||
|
||||
Reference in New Issue
Block a user