mirror of
				https://gitea.com/actions/cache.git
				synced 2025-10-31 07:47:07 +00:00 
			
		
		
		
	Add more debugging
This commit is contained in:
		
							
								
								
									
										2
									
								
								dist/restore/index.js
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								dist/restore/index.js
									
									
									
									
										vendored
									
									
								
							| @@ -1625,12 +1625,14 @@ function saveCache(cacheId, archivePath) { | ||||
|         const stream = fs.createReadStream(archivePath); | ||||
|         let streamIsClosed = false; | ||||
|         stream.on("close", () => { | ||||
|             core.debug("Stream is closed"); | ||||
|             streamIsClosed = true; | ||||
|         }); | ||||
|         const resourceUrl = getCacheApiUrl() + cacheId.toString(); | ||||
|         const uploads = []; | ||||
|         let offset = 0; | ||||
|         while (!streamIsClosed) { | ||||
|             core.debug(`Offset: ${offset}`); | ||||
|             const chunk = stream.read(MAX_CHUNK_SIZE); | ||||
|             uploads.push(uploadChunk(restClient, resourceUrl, chunk, offset)); | ||||
|             offset += MAX_CHUNK_SIZE; | ||||
|   | ||||
							
								
								
									
										2
									
								
								dist/save/index.js
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								dist/save/index.js
									
									
									
									
										vendored
									
									
								
							| @@ -1625,12 +1625,14 @@ function saveCache(cacheId, archivePath) { | ||||
|         const stream = fs.createReadStream(archivePath); | ||||
|         let streamIsClosed = false; | ||||
|         stream.on("close", () => { | ||||
|             core.debug("Stream is closed"); | ||||
|             streamIsClosed = true; | ||||
|         }); | ||||
|         const resourceUrl = getCacheApiUrl() + cacheId.toString(); | ||||
|         const uploads = []; | ||||
|         let offset = 0; | ||||
|         while (!streamIsClosed) { | ||||
|             core.debug(`Offset: ${offset}`); | ||||
|             const chunk = stream.read(MAX_CHUNK_SIZE); | ||||
|             uploads.push(uploadChunk(restClient, resourceUrl, chunk, offset)); | ||||
|             offset += MAX_CHUNK_SIZE; | ||||
|   | ||||
| @@ -186,6 +186,7 @@ export async function saveCache( | ||||
|     const stream = fs.createReadStream(archivePath); | ||||
|     let streamIsClosed = false; | ||||
|     stream.on("close", () => { | ||||
|         core.debug("Stream is closed"); | ||||
|         streamIsClosed = true; | ||||
|     }); | ||||
|  | ||||
| @@ -193,6 +194,7 @@ export async function saveCache( | ||||
|     const uploads: Promise<IRestResponse<void>>[] = []; | ||||
|     let offset = 0; | ||||
|     while (!streamIsClosed) { | ||||
|         core.debug(`Offset: ${offset}`); | ||||
|         const chunk: Buffer = stream.read(MAX_CHUNK_SIZE); | ||||
|         uploads.push(uploadChunk(restClient, resourceUrl, chunk, offset)); | ||||
|         offset += MAX_CHUNK_SIZE; | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Josh Gross
					Josh Gross