about summary refs log tree commit diff
path: root/src/libstore/store-api.cc
diff options
context:
space:
mode:
authorEelco Dolstra <eelco.dolstra@logicblox.com>2016-06-20T15·39+0200
committerEelco Dolstra <eelco.dolstra@logicblox.com>2016-06-20T15·39+0200
commit74dd603495273fe8b81d8635676861792cf420e8 (patch)
tree6efc8e8a53b08ce77cd439361d0c6c6eefda1d6d /src/libstore/store-api.cc
parentfffacd7c780f2fcd1be9ab78793d30dcf4fe599b (diff)
Re-implement negative binary cache lookup caching
Diffstat (limited to 'src/libstore/store-api.cc')
-rw-r--r--src/libstore/store-api.cc10
1 files changed, 7 insertions, 3 deletions
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<const ValidPathInfo> Store::queryPathInfo(const Path & storePath)
 
     auto info = queryPathInfoUncached(storePath);
 
-    if (diskCache && info)
+    if (diskCache)
         diskCache->upsertNarInfo(getUri(), hashPart, info);
 
     {