@ -3278,9 +3278,11 @@ function reserveCache(key, paths, options) {
version ,
version ,
cacheSize : options === null || options === void 0 ? void 0 : options . cacheSize
cacheSize : options === null || options === void 0 ? void 0 : options . cacheSize
} ;
} ;
const response = yield requestUtils _1 . retry Typed Response( 'reserveCache' , ( ) => _ _awaiter ( this , void 0 , void 0 , function * ( ) {
const response = yield requestUtils _1 . retry HttpClient Response( 'reserveCache' , ( ) => _ _awaiter ( this , void 0 , void 0 , function * ( ) {
return httpClient . post Json ( getCacheApiUrl ( 'caches' ) , reserveCacheRequest) ;
return httpClient . post ( getCacheApiUrl ( 'caches' ) , JSON. stringify ( reserveCacheRequest) ) ;
} ) ) ;
} ) ) ;
console . log ( "\n\nResponse\n\n" ) ;
console . log ( response ) ;
return response ;
return response ;
} ) ;
} ) ;
}
}
@ -46426,7 +46428,6 @@ exports.restoreCache = restoreCache;
* @ returns number returns cacheId if the cache was saved successfully and throws an error if save fails
* @ returns number returns cacheId if the cache was saved successfully and throws an error if save fails
* /
* /
function saveCache ( paths , key , options ) {
function saveCache ( paths , key , options ) {
var _a , _b ;
return _ _awaiter ( this , void 0 , void 0 , function * ( ) {
return _ _awaiter ( this , void 0 , void 0 , function * ( ) {
checkPaths ( paths ) ;
checkPaths ( paths ) ;
checkKey ( key ) ;
checkKey ( key ) ;
@ -46451,16 +46452,20 @@ function saveCache(paths, key, options) {
compressionMethod ,
compressionMethod ,
cacheSize
cacheSize
} ) ;
} ) ;
console . log ( reserveCacheResponse ) ;
// if(reserveCacheResponse?.statusCode === 400 && reserveCacheResponse?.result?.typeKey === "InvalidReserveCacheRequestException"){
if ( ( reserveCacheResponse === null || reserveCacheResponse === void 0 ? void 0 : reserveCacheResponse . statusCode ) === 400 ) {
// throw new ReserveCacheError(
throw new ReserveCacheError ( ` Cache size of ~ ${ Math . round ( archiveFileSize / ( 1024 * 1024 ) ) } MB ( ${ archiveFileSize } B) is over the data cap limit, not saving cache. ` ) ;
// reserveCacheResponse?.result?.message ??
}
// `Cache size of ~${Math.round(archiveFileSize / (1024 * 1024))} MB (${archiveFileSize} B) is over the data cap limit, not saving cache.`
if ( ( _a = reserveCacheResponse === null || reserveCacheResponse === void 0 ? void 0 : reserveCacheResponse . result ) === null || _a === void 0 ? void 0 : _a . cacheId ) {
// )
cacheId = ( _b = reserveCacheResponse === null || reserveCacheResponse === void 0 ? void 0 : reserveCacheResponse . result ) === null || _b === void 0 ? void 0 : _b . cacheId ;
// }
}
// if(reserveCacheResponse?.result?.cacheId){
else {
// cacheId = reserveCacheResponse?.result?.cacheId
throw new ReserveCacheError ( ` Unable to reserve cache with key ${ key } , another job may be creating this cache. ` ) ;
// }else{
}
// throw new ReserveCacheError(
// `Unable to reserve cache with key ${key}, another job may be creating this cache.`
// )
// }
throw new ReserveCacheError ( ` Unable to reserve cache with key ${ key } , another job may be creating this cache. ` ) ;
core . debug ( ` Cache ID: ${ cacheId } ` ) ;
core . debug ( ` Cache ID: ${ cacheId } ` ) ;
core . debug ( ` Saving Cache (ID: ${ cacheId } ) ` ) ;
core . debug ( ` Saving Cache (ID: ${ cacheId } ) ` ) ;
yield cacheHttpClient . saveCache ( cacheId , archivePath , options ) ;
yield cacheHttpClient . saveCache ( cacheId , archivePath , options ) ;
@ -51558,8 +51563,6 @@ function retryTypedResponse(name, method, maxAttempts = constants_1.DefaultRetry
// an ITypedResponse<T> so it can be processed by the retry logic.
// an ITypedResponse<T> so it can be processed by the retry logic.
( error ) => {
( error ) => {
if ( error instanceof http _client _1 . HttpClientError ) {
if ( error instanceof http _client _1 . HttpClientError ) {
console . log ( "\n\nRESULT\n\n" ) ;
console . log ( error . result ) ;
return {
return {
statusCode : error . statusCode ,
statusCode : error . statusCode ,
result : null ,
result : null ,