forked from lix-project/lix
NarInfoDiskCache: Rename cacheExists -> upToDateCacheExists
This is slightly more accurate considering that an outdated record may exist in the persistent cache. Possibly-outdated records are quite relevant as they may be foreign keys to more recent information that we want to keep, but we will not return them here.
This commit is contained in:
parent
8a0ef5d58e
commit
29f0b196f4
|
@ -56,7 +56,7 @@ public:
|
||||||
void init() override
|
void init() override
|
||||||
{
|
{
|
||||||
// FIXME: do this lazily?
|
// FIXME: do this lazily?
|
||||||
if (auto cacheInfo = diskCache->cacheExists(cacheUri)) {
|
if (auto cacheInfo = diskCache->upToDateCacheExists(cacheUri)) {
|
||||||
wantMassQuery.setDefault(cacheInfo->wantMassQuery);
|
wantMassQuery.setDefault(cacheInfo->wantMassQuery);
|
||||||
priority.setDefault(cacheInfo->priority);
|
priority.setDefault(cacheInfo->priority);
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -200,7 +200,7 @@ public:
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
std::optional<CacheInfo> cacheExists(const std::string & uri) override
|
std::optional<CacheInfo> upToDateCacheExists(const std::string & uri) override
|
||||||
{
|
{
|
||||||
return retrySQLite<std::optional<CacheInfo>>([&]() -> std::optional<CacheInfo> {
|
return retrySQLite<std::optional<CacheInfo>>([&]() -> std::optional<CacheInfo> {
|
||||||
auto state(_state.lock());
|
auto state(_state.lock());
|
||||||
|
|
|
@ -22,7 +22,7 @@ public:
|
||||||
int priority;
|
int priority;
|
||||||
};
|
};
|
||||||
|
|
||||||
virtual std::optional<CacheInfo> cacheExists(const std::string & uri) = 0;
|
virtual std::optional<CacheInfo> upToDateCacheExists(const std::string & uri) = 0;
|
||||||
|
|
||||||
virtual std::pair<Outcome, std::shared_ptr<NarInfo>> lookupNarInfo(
|
virtual std::pair<Outcome, std::shared_ptr<NarInfo>> lookupNarInfo(
|
||||||
const std::string & uri, const std::string & hashPart) = 0;
|
const std::string & uri, const std::string & hashPart) = 0;
|
||||||
|
|
|
@ -238,7 +238,7 @@ struct S3BinaryCacheStoreImpl : virtual S3BinaryCacheStoreConfig, public virtual
|
||||||
|
|
||||||
void init() override
|
void init() override
|
||||||
{
|
{
|
||||||
if (auto cacheInfo = diskCache->cacheExists(getUri())) {
|
if (auto cacheInfo = diskCache->upToDateCacheExists(getUri())) {
|
||||||
wantMassQuery.setDefault(cacheInfo->wantMassQuery);
|
wantMassQuery.setDefault(cacheInfo->wantMassQuery);
|
||||||
priority.setDefault(cacheInfo->priority);
|
priority.setDefault(cacheInfo->priority);
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in a new issue