mirror of https://github.com/actions/toolkit
Update the useragent of the old http client to pass cache version
parent
27e5cf2514
commit
af3981c955
|
@ -161,14 +161,11 @@ async function restoreCacheV1(
|
||||||
)
|
)
|
||||||
core.debug(`Archive Path: ${archivePath}`)
|
core.debug(`Archive Path: ${archivePath}`)
|
||||||
|
|
||||||
// Download the cache archive from from blob storage
|
// Download the cache from the cache entry
|
||||||
await cacheHttpClient.downloadCache(
|
await cacheHttpClient.downloadCache(
|
||||||
cacheEntry.archiveLocation,
|
cacheEntry.archiveLocation,
|
||||||
archivePath,
|
archivePath,
|
||||||
options ||
|
options
|
||||||
({
|
|
||||||
timeoutInMs: 30000
|
|
||||||
} as DownloadOptions)
|
|
||||||
)
|
)
|
||||||
|
|
||||||
if (core.isDebug()) {
|
if (core.isDebug()) {
|
||||||
|
|
|
@ -34,6 +34,7 @@ import {
|
||||||
retryTypedResponse
|
retryTypedResponse
|
||||||
} from './requestUtils'
|
} from './requestUtils'
|
||||||
import { getCacheServiceURL } from './config'
|
import { getCacheServiceURL } from './config'
|
||||||
|
import { getUserAgentString } from './shared/user-agent'
|
||||||
|
|
||||||
function getCacheApiUrl(resource: string): string {
|
function getCacheApiUrl(resource: string): string {
|
||||||
const baseUrl: string = getCacheServiceURL()
|
const baseUrl: string = getCacheServiceURL()
|
||||||
|
@ -65,7 +66,7 @@ function createHttpClient(): HttpClient {
|
||||||
const bearerCredentialHandler = new BearerCredentialHandler(token)
|
const bearerCredentialHandler = new BearerCredentialHandler(token)
|
||||||
|
|
||||||
return new HttpClient(
|
return new HttpClient(
|
||||||
'actions/cache',
|
getUserAgentString(),
|
||||||
[bearerCredentialHandler],
|
[bearerCredentialHandler],
|
||||||
getRequestOptions()
|
getRequestOptions()
|
||||||
)
|
)
|
||||||
|
@ -216,8 +217,7 @@ async function uploadChunk(
|
||||||
end: number
|
end: number
|
||||||
): Promise<void> {
|
): Promise<void> {
|
||||||
core.debug(
|
core.debug(
|
||||||
`Uploading chunk of size ${
|
`Uploading chunk of size ${end - start + 1
|
||||||
end - start + 1
|
|
||||||
} bytes at offset ${start} with content range: ${getContentRange(
|
} bytes at offset ${start} with content range: ${getContentRange(
|
||||||
start,
|
start,
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue