mirror of
				https://github.com/actions/cache.git
				synced 2025-11-04 07:38:37 +08:00 
			
		
		
		
	fix: Output chache hit timing
This commit is contained in:
		
							parent
							
								
									6f5b5ee729
								
							
						
					
					
						commit
						8addae5fff
					
				
							
								
								
									
										2
									
								
								dist/restore-only/index.js
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								dist/restore-only/index.js
									
									
									
									
										vendored
									
									
								
							| 
						 | 
					@ -59415,6 +59415,7 @@ function restoreImpl(stateProvider, earlyExit) {
 | 
				
			||||||
            const lookupOnly = utils.getInputAsBool(constants_1.Inputs.LookupOnly);
 | 
					            const lookupOnly = utils.getInputAsBool(constants_1.Inputs.LookupOnly);
 | 
				
			||||||
            const cacheKey = yield cache.restoreCache(cachePaths, primaryKey, restoreKeys, { lookupOnly: lookupOnly }, enableCrossOsArchive);
 | 
					            const cacheKey = yield cache.restoreCache(cachePaths, primaryKey, restoreKeys, { lookupOnly: lookupOnly }, enableCrossOsArchive);
 | 
				
			||||||
            if (!cacheKey) {
 | 
					            if (!cacheKey) {
 | 
				
			||||||
 | 
					                core.setOutput(constants_1.Outputs.CacheHit, false.toString());
 | 
				
			||||||
                if (failOnCacheMiss) {
 | 
					                if (failOnCacheMiss) {
 | 
				
			||||||
                    throw new Error(`Failed to restore cache entry. Exiting as fail-on-cache-miss is set. Input key: ${primaryKey}`);
 | 
					                    throw new Error(`Failed to restore cache entry. Exiting as fail-on-cache-miss is set. Input key: ${primaryKey}`);
 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
| 
						 | 
					@ -59422,7 +59423,6 @@ function restoreImpl(stateProvider, earlyExit) {
 | 
				
			||||||
                    primaryKey,
 | 
					                    primaryKey,
 | 
				
			||||||
                    ...restoreKeys
 | 
					                    ...restoreKeys
 | 
				
			||||||
                ].join(", ")}`);
 | 
					                ].join(", ")}`);
 | 
				
			||||||
                core.setOutput(constants_1.Outputs.CacheHit, false.toString());
 | 
					 | 
				
			||||||
                return;
 | 
					                return;
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
            // Store the matched cache key in states
 | 
					            // Store the matched cache key in states
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
							
								
								
									
										2
									
								
								dist/restore/index.js
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								dist/restore/index.js
									
									
									
									
										vendored
									
									
								
							| 
						 | 
					@ -59415,6 +59415,7 @@ function restoreImpl(stateProvider, earlyExit) {
 | 
				
			||||||
            const lookupOnly = utils.getInputAsBool(constants_1.Inputs.LookupOnly);
 | 
					            const lookupOnly = utils.getInputAsBool(constants_1.Inputs.LookupOnly);
 | 
				
			||||||
            const cacheKey = yield cache.restoreCache(cachePaths, primaryKey, restoreKeys, { lookupOnly: lookupOnly }, enableCrossOsArchive);
 | 
					            const cacheKey = yield cache.restoreCache(cachePaths, primaryKey, restoreKeys, { lookupOnly: lookupOnly }, enableCrossOsArchive);
 | 
				
			||||||
            if (!cacheKey) {
 | 
					            if (!cacheKey) {
 | 
				
			||||||
 | 
					                core.setOutput(constants_1.Outputs.CacheHit, false.toString());
 | 
				
			||||||
                if (failOnCacheMiss) {
 | 
					                if (failOnCacheMiss) {
 | 
				
			||||||
                    throw new Error(`Failed to restore cache entry. Exiting as fail-on-cache-miss is set. Input key: ${primaryKey}`);
 | 
					                    throw new Error(`Failed to restore cache entry. Exiting as fail-on-cache-miss is set. Input key: ${primaryKey}`);
 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
| 
						 | 
					@ -59422,7 +59423,6 @@ function restoreImpl(stateProvider, earlyExit) {
 | 
				
			||||||
                    primaryKey,
 | 
					                    primaryKey,
 | 
				
			||||||
                    ...restoreKeys
 | 
					                    ...restoreKeys
 | 
				
			||||||
                ].join(", ")}`);
 | 
					                ].join(", ")}`);
 | 
				
			||||||
                core.setOutput(constants_1.Outputs.CacheHit, false.toString());
 | 
					 | 
				
			||||||
                return;
 | 
					                return;
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
            // Store the matched cache key in states
 | 
					            // Store the matched cache key in states
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue
	
	Block a user