From 451ebf24ce532f8d59f929efd486104fcebf1aa6 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Wed, 20 Apr 2016 14:12:38 +0200 Subject: Cache path info lookups in SQLite This re-implements the binary cache database in C++, allowing it to be used by other Store backends, in particular the S3 backend. --- src/libstore/binary-cache-store.cc | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/libstore/binary-cache-store.cc') diff --git a/src/libstore/binary-cache-store.cc b/src/libstore/binary-cache-store.cc index 81800d4cb24e..3857ed93e212 100644 --- a/src/libstore/binary-cache-store.cc +++ b/src/libstore/binary-cache-store.cc @@ -59,7 +59,7 @@ void BinaryCacheStore::addToCache(const ValidPathInfo & info, narInfo->narSize = nar.size(); narInfo->narHash = hashString(htSHA256, nar); - if (info.narHash.type != htUnknown && info.narHash != narInfo->narHash) + if (info.narHash && info.narHash != narInfo->narHash) throw Error(format("refusing to copy corrupted path ‘%1%’ to binary cache") % info.path); /* Compress the NAR. */ @@ -96,7 +96,6 @@ void BinaryCacheStore::addToCache(const ValidPathInfo & info, { auto state_(state.lock()); state_->pathInfoCache.upsert(narInfo->path, std::shared_ptr(narInfo)); - stats.pathInfoCacheSize = state_->pathInfoCache.size(); } stats.narInfoWrite++; -- cgit 1.4.1