From 74dd603495273fe8b81d8635676861792cf420e8 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Mon, 20 Jun 2016 17:39:05 +0200 Subject: Re-implement negative binary cache lookup caching --- src/libstore/store-api.cc | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'src/libstore/store-api.cc') diff --git a/src/libstore/store-api.cc b/src/libstore/store-api.cc index c6616a43d708..2a062b9b2cd3 100644 --- a/src/libstore/store-api.cc +++ b/src/libstore/store-api.cc @@ -265,9 +265,13 @@ bool Store::isValidPath(const Path & storePath) } } - return isValidPathUncached(storePath); + bool valid = isValidPathUncached(storePath); - // FIXME: insert result into NARExistence table of diskCache. + if (diskCache && !valid) + // FIXME: handle valid = true case. + diskCache->upsertNarInfo(getUri(), hashPart, 0); + + return valid; } @@ -302,7 +306,7 @@ ref Store::queryPathInfo(const Path & storePath) auto info = queryPathInfoUncached(storePath); - if (diskCache && info) + if (diskCache) diskCache->upsertNarInfo(getUri(), hashPart, info); { -- cgit 1.4.1