about summary refs log tree commit diff
path: root/src/libstore/store-api.hh
diff options
context:
space:
mode:
authorEelco Dolstra <edolstra@gmail.com>2017-04-06T13·22+0200
committerEelco Dolstra <edolstra@gmail.com>2017-04-06T13·22+0200
commit6b5e2711632c345f2b6a371ef8a859106436980a (patch)
treed8282582faad6c20903e6156029445aa5288b8c0 /src/libstore/store-api.hh
parent256940fc48a6db950136fb0bc43590b701a3e857 (diff)
Add a method to allow hydra-queue-runner to flush the path info cache
Diffstat (limited to 'src/libstore/store-api.hh')
-rw-r--r--src/libstore/store-api.hh12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/libstore/store-api.hh b/src/libstore/store-api.hh
index f58dbde350c7..e07dec495470 100644
--- a/src/libstore/store-api.hh
+++ b/src/libstore/store-api.hh
@@ -252,11 +252,6 @@ protected:
 
 public:
 
-    size_t getCacheSize()
-    {
-        return state.lock()->pathInfoCache.size();
-    }
-
     virtual ~Store() { }
 
     virtual std::string getUri() = 0;
@@ -578,6 +573,13 @@ public:
     virtual std::shared_ptr<std::string> getBuildLog(const Path & path)
     { return nullptr; }
 
+    /* Hack to allow long-running processes like hydra-queue-runner to
+       occasionally flush their path info cache. */
+    void clearPathInfoCache()
+    {
+        state.lock()->pathInfoCache.clear();
+    }
+
 protected:
 
     Stats stats;