Errors writing to the NAR cache should not be fatal
This commit is contained in:
		
							parent
							
								
									d8306148e0
								
							
						
					
					
						commit
						75cd75b1ae
					
				
					 1 changed files with 5 additions and 1 deletions
				
			
		| 
						 | 
					@ -19,9 +19,13 @@ Path RemoteFSAccessor::makeCacheFile(const Path & storePath)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void RemoteFSAccessor::addToCache(const Path & storePath, const std::string & nar)
 | 
					void RemoteFSAccessor::addToCache(const Path & storePath, const std::string & nar)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
    if (cacheDir != "")
 | 
					    try {
 | 
				
			||||||
 | 
					        if (cacheDir == "") return;
 | 
				
			||||||
        /* FIXME: do this asynchronously. */
 | 
					        /* FIXME: do this asynchronously. */
 | 
				
			||||||
        writeFile(makeCacheFile(storePath), nar);
 | 
					        writeFile(makeCacheFile(storePath), nar);
 | 
				
			||||||
 | 
					    } catch (...) {
 | 
				
			||||||
 | 
					        ignoreException();
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
std::pair<ref<FSAccessor>, Path> RemoteFSAccessor::fetch(const Path & path_)
 | 
					std::pair<ref<FSAccessor>, Path> RemoteFSAccessor::fetch(const Path & path_)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue