diff options
Diffstat (limited to 'src/zenserver/cache/structuredcachestore.cpp')
| -rw-r--r-- | src/zenserver/cache/structuredcachestore.cpp | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/zenserver/cache/structuredcachestore.cpp b/src/zenserver/cache/structuredcachestore.cpp index d56b3cfe2..3a6e5cbc3 100644 --- a/src/zenserver/cache/structuredcachestore.cpp +++ b/src/zenserver/cache/structuredcachestore.cpp @@ -1006,7 +1006,7 @@ ZenCacheDiskLayer::CacheBucket::OpenLog(const bool IsNew) { LogEntryCount = ReadLog(LogPath, m_LogFlushPosition); } - else + else if (fs::is_regular_file(LogPath)) { ZEN_WARN("removing invalid cas log at '{}'", LogPath); std::filesystem::remove(LogPath); @@ -1512,7 +1512,7 @@ ZenCacheDiskLayer::CacheBucket::GatherReferences(GcContext& GcCtx) NiceLatencyNs(ReadBlockLongestTimeUs)); }); - const GcClock::TimePoint ExpireTime = GcCtx.ExpireTime(); + const GcClock::TimePoint ExpireTime = GcCtx.CacheExpireTime(); const GcClock::Tick ExpireTicks = ExpireTime.time_since_epoch().count(); @@ -2976,7 +2976,7 @@ TEST_CASE("z$.gc") GcClock::Duration MaxDuration, std::span<const IoHash> Cids, std::vector<IoHash>& OutKeep) { - GcContext GcCtx(Time - MaxDuration); + GcContext GcCtx(Time - MaxDuration, Time - MaxDuration); Gc.CollectGarbage(GcCtx); OutKeep.clear(); GcCtx.FilterCids(Cids, [&OutKeep](const IoHash& Hash) { OutKeep.push_back(Hash); }); @@ -3055,7 +3055,7 @@ TEST_CASE("z$.gc") } { - GcContext GcCtx(CurrentTime - std::chrono::hours(46)); + GcContext GcCtx(CurrentTime - std::chrono::hours(46), CurrentTime - std::chrono::hours(46)); Gc.CollectGarbage(GcCtx); @@ -3069,7 +3069,7 @@ TEST_CASE("z$.gc") // Move forward in time and collect again { - GcContext GcCtx(CurrentTime + std::chrono::minutes(2)); + GcContext GcCtx(CurrentTime + std::chrono::minutes(2), CurrentTime + std::chrono::minutes(2)); Gc.CollectGarbage(GcCtx); for (const auto& Key : Keys) @@ -3099,7 +3099,7 @@ TEST_CASE("z$.gc") } { - GcContext GcCtx(GcClock::Now() - std::chrono::hours(2)); + GcContext GcCtx(GcClock::Now() - std::chrono::hours(2), GcClock::Now() - std::chrono::hours(2)); GcCtx.CollectSmallObjects(true); Gc.CollectGarbage(GcCtx); @@ -3114,7 +3114,7 @@ TEST_CASE("z$.gc") // Move forward in time and collect again { - GcContext GcCtx(GcClock::Now() + std::chrono::minutes(2)); + GcContext GcCtx(GcClock::Now() + std::chrono::minutes(2), GcClock::Now() + std::chrono::minutes(2)); GcCtx.CollectSmallObjects(true); Zcs.Flush(); @@ -3303,7 +3303,7 @@ TEST_CASE("z$.threadedinsert") // * doctest::skip(true)) C++; } - GcContext GcCtx(GcClock::Now() - std::chrono::hours(24)); + GcContext GcCtx(GcClock::Now() - std::chrono::hours(24), GcClock::Now() - std::chrono::hours(24)); GcCtx.CollectSmallObjects(true); GcCtx.AddRetainedCids(KeepHashes); Zcs.CollectGarbage(GcCtx); @@ -3351,7 +3351,7 @@ TEST_CASE("z$.threadedinsert") // * doctest::skip(true)) C++; } - GcContext GcCtx(GcClock::Now() - std::chrono::hours(24)); + GcContext GcCtx(GcClock::Now() - std::chrono::hours(24), GcClock::Now() - std::chrono::hours(24)); GcCtx.CollectSmallObjects(true); GcCtx.AddRetainedCids(KeepHashes); Zcs.CollectGarbage(GcCtx); |