about summary refs log tree commit diff
path: root/src/libstore/store-api.cc
diff options
context:
space:
mode:
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);
 
     {