mirror of
https://github.com/NixOS/nix.git
synced 2025-11-09 12:06:01 +01:00
RemoteStore::addToStoreFromDump(): Invalidate cache entry for added path
This commit is contained in:
parent
c82b67fa05
commit
f51779ee25
3 changed files with 10 additions and 1 deletions
|
|
@ -311,6 +311,8 @@ protected:
|
||||||
LRUCache<std::string, PathInfoCacheValue> pathInfoCache;
|
LRUCache<std::string, PathInfoCacheValue> pathInfoCache;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
void invalidatePathInfoCacheFor(const StorePath & path);
|
||||||
|
|
||||||
SharedSync<State> state;
|
SharedSync<State> state;
|
||||||
|
|
||||||
std::shared_ptr<NarInfoDiskCache> diskCache;
|
std::shared_ptr<NarInfoDiskCache> diskCache;
|
||||||
|
|
|
||||||
|
|
@ -457,7 +457,9 @@ StorePath RemoteStore::addToStoreFromDump(
|
||||||
}
|
}
|
||||||
if (fsm != dumpMethod)
|
if (fsm != dumpMethod)
|
||||||
unsupported("RemoteStore::addToStoreFromDump doesn't support this `dumpMethod` `hashMethod` combination");
|
unsupported("RemoteStore::addToStoreFromDump doesn't support this `dumpMethod` `hashMethod` combination");
|
||||||
return addCAToStore(dump, name, hashMethod, hashAlgo, references, repair)->path;
|
auto storePath = addCAToStore(dump, name, hashMethod, hashAlgo, references, repair)->path;
|
||||||
|
invalidatePathInfoCacheFor(storePath);
|
||||||
|
return storePath;
|
||||||
}
|
}
|
||||||
|
|
||||||
void RemoteStore::addToStore(const ValidPathInfo & info, Source & source, RepairFlag repair, CheckSigsFlag checkSigs)
|
void RemoteStore::addToStore(const ValidPathInfo & info, Source & source, RepairFlag repair, CheckSigsFlag checkSigs)
|
||||||
|
|
|
||||||
|
|
@ -319,6 +319,11 @@ bool Store::PathInfoCacheValue::isKnownNow()
|
||||||
return std::chrono::steady_clock::now() < time_point + ttl;
|
return std::chrono::steady_clock::now() < time_point + ttl;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Store::invalidatePathInfoCacheFor(const StorePath & path)
|
||||||
|
{
|
||||||
|
state.lock()->pathInfoCache.erase(path.to_string());
|
||||||
|
}
|
||||||
|
|
||||||
std::map<std::string, std::optional<StorePath>> Store::queryStaticPartialDerivationOutputMap(const StorePath & path)
|
std::map<std::string, std::optional<StorePath>> Store::queryStaticPartialDerivationOutputMap(const StorePath & path)
|
||||||
{
|
{
|
||||||
std::map<std::string, std::optional<StorePath>> outputs;
|
std::map<std::string, std::optional<StorePath>> outputs;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue