Add a method to allow hydra-queue-runner to flush the path info cache

This commit is contained in:
Eelco Dolstra 2017-04-06 15:22:37 +02:00
parent 256940fc48
commit 6b5e271163
No known key found for this signature in database
GPG key ID: 8170B4726D7198DE

View file

@ -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;