Cleanup implementation and use tarballs instead of streaming zip

This commit is contained in:
Bassem Dghaidi
2024-10-21 05:21:32 -07:00
committed by GitHub
parent d399e33060
commit 89354f6540
6 changed files with 173 additions and 242 deletions
+10 -3
View File
@@ -1,8 +1,8 @@
import { HttpClient, HttpClientResponse, HttpCodes } from '@actions/http-client'
import { BearerCredentialHandler } from '@actions/http-client/lib/auth'
import { info, debug } from '@actions/core'
import { CacheServiceClientJSON } from '../generated/results/api/v1/cache.twirp'
import { getRuntimeToken, getCacheServiceURL } from './config'
import { BearerCredentialHandler } from '@actions/http-client/lib/auth'
import { HttpClient, HttpClientResponse, HttpCodes } from '@actions/http-client'
import { CacheServiceClientJSON } from '../generated/results/api/v1/cache.twirp'
// import {getUserAgentString} from './user-agent'
// import {NetworkError, UsageError} from './errors'
@@ -16,6 +16,13 @@ interface Rpc {
): Promise<object | Uint8Array>
}
/**
* This class is a wrapper around the CacheServiceClientJSON class generated by Twirp.
*
* It adds retry logic to the request method, which is not present in the generated client.
*
* This class is used to interact with cache service v2.
*/
class CacheServiceClient implements Rpc {
private httpClient: HttpClient
private baseUrl: string