mirror of
				https://github.com/gradle/gradle-build-action.git
				synced 2025-11-04 09:58:56 +08:00 
			
		
		
		
	Do not fail action on cache errors
Ensure that we catch and log errors in `beforeSave` and `afterRestore`, and do not fail the entire workflow in these cases.
This commit is contained in:
		
							
								
								
									
										2
									
								
								dist/main/index.js
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								dist/main/index.js
									
									
									
									
										vendored
									
									
								
							
										
											
												File diff suppressed because one or more lines are too long
											
										
									
								
							
							
								
								
									
										2
									
								
								dist/main/index.js.map
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								dist/main/index.js.map
									
									
									
									
										vendored
									
									
								
							
										
											
												File diff suppressed because one or more lines are too long
											
										
									
								
							
							
								
								
									
										2
									
								
								dist/post/index.js
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								dist/post/index.js
									
									
									
									
										vendored
									
									
								
							
										
											
												File diff suppressed because one or more lines are too long
											
										
									
								
							
							
								
								
									
										2
									
								
								dist/post/index.js.map
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								dist/post/index.js.map
									
									
									
									
										vendored
									
									
								
							
										
											
												File diff suppressed because one or more lines are too long
											
										
									
								
							@@ -141,7 +141,13 @@ export abstract class AbstractCache {
 | 
			
		||||
            `Restored ${this.cacheDescription} from cache key: ${cacheResult}`
 | 
			
		||||
        )
 | 
			
		||||
 | 
			
		||||
        await this.afterRestore()
 | 
			
		||||
        try {
 | 
			
		||||
            await this.afterRestore()
 | 
			
		||||
        } catch (error) {
 | 
			
		||||
            core.warning(
 | 
			
		||||
                `Restore ${this.cacheDescription} failed in 'afterRestore': ${error}`
 | 
			
		||||
            )
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        return
 | 
			
		||||
    }
 | 
			
		||||
@@ -193,7 +199,14 @@ export abstract class AbstractCache {
 | 
			
		||||
            return
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        await this.beforeSave()
 | 
			
		||||
        try {
 | 
			
		||||
            await this.beforeSave()
 | 
			
		||||
        } catch (error) {
 | 
			
		||||
            core.warning(
 | 
			
		||||
                `Save ${this.cacheDescription} failed in 'beforeSave': ${error}`
 | 
			
		||||
            )
 | 
			
		||||
            return
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        core.info(
 | 
			
		||||
            `Caching ${this.cacheDescription} with cache key: ${cacheKey}`
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user