mirror of
				https://gitea.com/actions/cache.git
				synced 2025-10-31 07:47:07 +00:00 
			
		
		
		
	Implement cache v2
This commit is contained in:
		
							
								
								
									
										12
									
								
								dist/restore-only/index.js
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										12
									
								
								dist/restore-only/index.js
									
									
									
									
										vendored
									
									
								
							| @@ -10013,6 +10013,12 @@ function saveCache(paths, key, options, enableCrossOsArchive = false) { | |||||||
|             if (archiveFileSize > fileSizeLimit && !utils.isGhes()) { |             if (archiveFileSize > fileSizeLimit && !utils.isGhes()) { | ||||||
|                 throw new Error(`Cache size of ~${Math.round(archiveFileSize / (1024 * 1024))} MB (${archiveFileSize} B) is over the 10GB limit, not saving cache.`); |                 throw new Error(`Cache size of ~${Math.round(archiveFileSize / (1024 * 1024))} MB (${archiveFileSize} B) is over the 10GB limit, not saving cache.`); | ||||||
|             } |             } | ||||||
|  |             // Cache v2 upload
 | ||||||
|  |             // inputs:
 | ||||||
|  |             // - getSignedUploadURL
 | ||||||
|  |             // - archivePath
 | ||||||
|  |             core.debug(`Saving Cache v2: ${archivePath}`); | ||||||
|  |             yield (0, upload_cache_1.UploadCache)(signedUploadURL, archivePath); | ||||||
|             core.debug('Reserving Cache'); |             core.debug('Reserving Cache'); | ||||||
|             const reserveCacheResponse = yield cacheHttpClient.reserveCache(key, paths, { |             const reserveCacheResponse = yield cacheHttpClient.reserveCache(key, paths, { | ||||||
|                 compressionMethod, |                 compressionMethod, | ||||||
| @@ -10030,12 +10036,6 @@ function saveCache(paths, key, options, enableCrossOsArchive = false) { | |||||||
|             } |             } | ||||||
|             core.debug(`Saving Cache (ID: ${cacheId})`); |             core.debug(`Saving Cache (ID: ${cacheId})`); | ||||||
|             yield cacheHttpClient.saveCache(cacheId, archivePath, options); |             yield cacheHttpClient.saveCache(cacheId, archivePath, options); | ||||||
|             // Cache v2 upload
 |  | ||||||
|             // inputs:
 |  | ||||||
|             // - getSignedUploadURL
 |  | ||||||
|             // - archivePath
 |  | ||||||
|             core.debug(`Saving Cache v2: ${archivePath}`); |  | ||||||
|             yield (0, upload_cache_1.UploadCache)(signedUploadURL, archivePath); |  | ||||||
|         } |         } | ||||||
|         catch (error) { |         catch (error) { | ||||||
|             const typedError = error; |             const typedError = error; | ||||||
|   | |||||||
							
								
								
									
										12
									
								
								dist/restore/index.js
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										12
									
								
								dist/restore/index.js
									
									
									
									
										vendored
									
									
								
							| @@ -10013,6 +10013,12 @@ function saveCache(paths, key, options, enableCrossOsArchive = false) { | |||||||
|             if (archiveFileSize > fileSizeLimit && !utils.isGhes()) { |             if (archiveFileSize > fileSizeLimit && !utils.isGhes()) { | ||||||
|                 throw new Error(`Cache size of ~${Math.round(archiveFileSize / (1024 * 1024))} MB (${archiveFileSize} B) is over the 10GB limit, not saving cache.`); |                 throw new Error(`Cache size of ~${Math.round(archiveFileSize / (1024 * 1024))} MB (${archiveFileSize} B) is over the 10GB limit, not saving cache.`); | ||||||
|             } |             } | ||||||
|  |             // Cache v2 upload
 | ||||||
|  |             // inputs:
 | ||||||
|  |             // - getSignedUploadURL
 | ||||||
|  |             // - archivePath
 | ||||||
|  |             core.debug(`Saving Cache v2: ${archivePath}`); | ||||||
|  |             yield (0, upload_cache_1.UploadCache)(signedUploadURL, archivePath); | ||||||
|             core.debug('Reserving Cache'); |             core.debug('Reserving Cache'); | ||||||
|             const reserveCacheResponse = yield cacheHttpClient.reserveCache(key, paths, { |             const reserveCacheResponse = yield cacheHttpClient.reserveCache(key, paths, { | ||||||
|                 compressionMethod, |                 compressionMethod, | ||||||
| @@ -10030,12 +10036,6 @@ function saveCache(paths, key, options, enableCrossOsArchive = false) { | |||||||
|             } |             } | ||||||
|             core.debug(`Saving Cache (ID: ${cacheId})`); |             core.debug(`Saving Cache (ID: ${cacheId})`); | ||||||
|             yield cacheHttpClient.saveCache(cacheId, archivePath, options); |             yield cacheHttpClient.saveCache(cacheId, archivePath, options); | ||||||
|             // Cache v2 upload
 |  | ||||||
|             // inputs:
 |  | ||||||
|             // - getSignedUploadURL
 |  | ||||||
|             // - archivePath
 |  | ||||||
|             core.debug(`Saving Cache v2: ${archivePath}`); |  | ||||||
|             yield (0, upload_cache_1.UploadCache)(signedUploadURL, archivePath); |  | ||||||
|         } |         } | ||||||
|         catch (error) { |         catch (error) { | ||||||
|             const typedError = error; |             const typedError = error; | ||||||
|   | |||||||
							
								
								
									
										12
									
								
								dist/save-only/index.js
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										12
									
								
								dist/save-only/index.js
									
									
									
									
										vendored
									
									
								
							| @@ -10013,6 +10013,12 @@ function saveCache(paths, key, options, enableCrossOsArchive = false) { | |||||||
|             if (archiveFileSize > fileSizeLimit && !utils.isGhes()) { |             if (archiveFileSize > fileSizeLimit && !utils.isGhes()) { | ||||||
|                 throw new Error(`Cache size of ~${Math.round(archiveFileSize / (1024 * 1024))} MB (${archiveFileSize} B) is over the 10GB limit, not saving cache.`); |                 throw new Error(`Cache size of ~${Math.round(archiveFileSize / (1024 * 1024))} MB (${archiveFileSize} B) is over the 10GB limit, not saving cache.`); | ||||||
|             } |             } | ||||||
|  |             // Cache v2 upload
 | ||||||
|  |             // inputs:
 | ||||||
|  |             // - getSignedUploadURL
 | ||||||
|  |             // - archivePath
 | ||||||
|  |             core.info(`Saving Cache v2: ${archivePath}`); | ||||||
|  |             yield (0, upload_cache_1.UploadCache)(signedUploadURL, archivePath); | ||||||
|             core.debug('Reserving Cache'); |             core.debug('Reserving Cache'); | ||||||
|             const reserveCacheResponse = yield cacheHttpClient.reserveCache(key, paths, { |             const reserveCacheResponse = yield cacheHttpClient.reserveCache(key, paths, { | ||||||
|                 compressionMethod, |                 compressionMethod, | ||||||
| @@ -10030,12 +10036,6 @@ function saveCache(paths, key, options, enableCrossOsArchive = false) { | |||||||
|             } |             } | ||||||
|             core.debug(`Saving Cache (ID: ${cacheId})`); |             core.debug(`Saving Cache (ID: ${cacheId})`); | ||||||
|             yield cacheHttpClient.saveCache(cacheId, archivePath, options); |             yield cacheHttpClient.saveCache(cacheId, archivePath, options); | ||||||
|             // Cache v2 upload
 |  | ||||||
|             // inputs:
 |  | ||||||
|             // - getSignedUploadURL
 |  | ||||||
|             // - archivePath
 |  | ||||||
|             core.debug(`Saving Cache v2: ${archivePath}`); |  | ||||||
|             yield (0, upload_cache_1.UploadCache)(signedUploadURL, archivePath); |  | ||||||
|         } |         } | ||||||
|         catch (error) { |         catch (error) { | ||||||
|             const typedError = error; |             const typedError = error; | ||||||
|   | |||||||
							
								
								
									
										12
									
								
								dist/save/index.js
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										12
									
								
								dist/save/index.js
									
									
									
									
										vendored
									
									
								
							| @@ -10013,6 +10013,12 @@ function saveCache(paths, key, options, enableCrossOsArchive = false) { | |||||||
|             if (archiveFileSize > fileSizeLimit && !utils.isGhes()) { |             if (archiveFileSize > fileSizeLimit && !utils.isGhes()) { | ||||||
|                 throw new Error(`Cache size of ~${Math.round(archiveFileSize / (1024 * 1024))} MB (${archiveFileSize} B) is over the 10GB limit, not saving cache.`); |                 throw new Error(`Cache size of ~${Math.round(archiveFileSize / (1024 * 1024))} MB (${archiveFileSize} B) is over the 10GB limit, not saving cache.`); | ||||||
|             } |             } | ||||||
|  |             // Cache v2 upload
 | ||||||
|  |             // inputs:
 | ||||||
|  |             // - getSignedUploadURL
 | ||||||
|  |             // - archivePath
 | ||||||
|  |             core.debug(`Saving Cache v2: ${archivePath}`); | ||||||
|  |             yield (0, upload_cache_1.UploadCache)(signedUploadURL, archivePath); | ||||||
|             core.debug('Reserving Cache'); |             core.debug('Reserving Cache'); | ||||||
|             const reserveCacheResponse = yield cacheHttpClient.reserveCache(key, paths, { |             const reserveCacheResponse = yield cacheHttpClient.reserveCache(key, paths, { | ||||||
|                 compressionMethod, |                 compressionMethod, | ||||||
| @@ -10030,12 +10036,6 @@ function saveCache(paths, key, options, enableCrossOsArchive = false) { | |||||||
|             } |             } | ||||||
|             core.debug(`Saving Cache (ID: ${cacheId})`); |             core.debug(`Saving Cache (ID: ${cacheId})`); | ||||||
|             yield cacheHttpClient.saveCache(cacheId, archivePath, options); |             yield cacheHttpClient.saveCache(cacheId, archivePath, options); | ||||||
|             // Cache v2 upload
 |  | ||||||
|             // inputs:
 |  | ||||||
|             // - getSignedUploadURL
 |  | ||||||
|             // - archivePath
 |  | ||||||
|             core.debug(`Saving Cache v2: ${archivePath}`); |  | ||||||
|             yield (0, upload_cache_1.UploadCache)(signedUploadURL, archivePath); |  | ||||||
|         } |         } | ||||||
|         catch (error) { |         catch (error) { | ||||||
|             const typedError = error; |             const typedError = error; | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Bassem Dghaidi
					Bassem Dghaidi