From 6b5e2711632c345f2b6a371ef8a859106436980a Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Thu, 6 Apr 2017 15:22:37 +0200 Subject: Add a method to allow hydra-queue-runner to flush the path info cache --- src/libstore/store-api.hh | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'src/libstore/store-api.hh') diff --git a/src/libstore/store-api.hh b/src/libstore/store-api.hh index f58dbde35..e07dec495 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 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; -- cgit v1.2.3