Compare commits

..

1 Commits

Author SHA1 Message Date
Sampark Sharma c3215b7f68 Release patch version update for cache 2023-02-09 11:17:43 +00:00
3 changed files with 8 additions and 33 deletions
+6 -6
View File
@@ -8954,9 +8954,9 @@
"dev": true
},
"node_modules/http-cache-semantics": {
"version": "4.1.1",
"resolved": "https://registry.npmjs.org/http-cache-semantics/-/http-cache-semantics-4.1.1.tgz",
"integrity": "sha512-er295DKPVsV82j5kw1Gjt+ADA/XYHsajl82cGNQG2eyoPkvgUhX+nDIyelzhIWbbsXP39EHcI6l5tYs2FYqYXQ==",
"version": "4.1.0",
"resolved": "https://registry.npmjs.org/http-cache-semantics/-/http-cache-semantics-4.1.0.tgz",
"integrity": "sha512-carPklcUh7ROWRK7Cv27RPtdhYhUsela/ue5/jKzjegVvXDqM2ILE9Q2BGn9JZJh1g87cp56su/FgQSzcWS8cQ==",
"dev": true
},
"node_modules/http-proxy-agent": {
@@ -23868,9 +23868,9 @@
"dev": true
},
"http-cache-semantics": {
"version": "4.1.1",
"resolved": "https://registry.npmjs.org/http-cache-semantics/-/http-cache-semantics-4.1.1.tgz",
"integrity": "sha512-er295DKPVsV82j5kw1Gjt+ADA/XYHsajl82cGNQG2eyoPkvgUhX+nDIyelzhIWbbsXP39EHcI6l5tYs2FYqYXQ==",
"version": "4.1.0",
"resolved": "https://registry.npmjs.org/http-cache-semantics/-/http-cache-semantics-4.1.0.tgz",
"integrity": "sha512-carPklcUh7ROWRK7Cv27RPtdhYhUsela/ue5/jKzjegVvXDqM2ILE9Q2BGn9JZJh1g87cp56su/FgQSzcWS8cQ==",
"dev": true
},
"http-proxy-agent": {
+1 -26
View File
@@ -10,7 +10,7 @@ import * as util from 'util'
import * as utils from './cacheUtils'
import {SocketTimeout} from './constants'
import {DownloadOptions} from '../options'
import {retryHttpClientResponse, sleep} from './requestUtils'
import {retryHttpClientResponse} from './requestUtils'
import {AbortController} from '@azure/abort-controller'
@@ -161,28 +161,6 @@ export class DownloadProgress {
}
}
async function displayDownloadProgress(message: any, startTime: number): Promise<void> {
const socket = message.socket
while(!message.complete) {
const byteRead = socket.bytesRead
const totalBytes = 100000
const percentage = (100 * (byteRead / totalBytes)).toFixed(
1
)
const elapsedTime = Date.now() - startTime
const downloadSpeed = (
byteRead /
(1024 * 1024) /
(elapsedTime / 1000)
).toFixed(1)
core.info(
`Received ${byteRead} of ${totalBytes} (${percentage}%), ${downloadSpeed} MBs/sec`
)
sleep(100)
}
}
/**
* Download the cache using the Actions toolkit http-client
*
@@ -193,7 +171,6 @@ export async function downloadCacheHttpClient(
archiveLocation: string,
archivePath: string
): Promise<void> {
const startTime = Date.now()
const writeStream = fs.createWriteStream(archivePath)
const httpClient = new HttpClient('actions/cache')
const downloadResponse = await retryHttpClientResponse(
@@ -207,8 +184,6 @@ export async function downloadCacheHttpClient(
core.debug(`Aborting download, socket timed out after ${SocketTimeout} ms`)
})
await displayDownloadProgress(downloadResponse.message, startTime)
await pipeResponseToStream(downloadResponse, writeStream)
// Validate download size.
+1 -1
View File
@@ -33,7 +33,7 @@ export function isRetryableStatusCode(statusCode?: number): boolean {
return retryableStatusCodes.includes(statusCode)
}
export async function sleep(milliseconds: number): Promise<void> {
async function sleep(milliseconds: number): Promise<void> {
return new Promise(resolve => setTimeout(resolve, milliseconds))
}