Errors writing to the NAR cache should not be fatal

This commit is contained in:
Eelco Dolstra 2017-10-18 15:41:14 +02:00
parent d8306148e0
commit 75cd75b1ae
No known key found for this signature in database
GPG key ID: 8170B4726D7198DE

View file

@ -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_)