diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/zenstore/gc.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/zenstore/gc.cpp b/src/zenstore/gc.cpp index 8c3d802c3..b17103e43 100644 --- a/src/zenstore/gc.cpp +++ b/src/zenstore/gc.cpp @@ -1781,8 +1781,16 @@ GcScheduler::Initialize(const GcSchedulerConfig& Config) m_AttachmentPassIndex = SchedulerState["AttachmentPassIndex"sv].AsUInt8(); } + const std::filesystem::path GcDiskUsageLogPath = m_Config.RootDirectory / "gc.dlog"; + if (!TCasLogFile<DiskUsageWindow::DiskUsageEntry>::IsValid(GcDiskUsageLogPath)) + { + ZEN_WARN("GC disk usage log at '{}' is malformed, restarting log", GcDiskUsageLogPath); + RemoveFile(GcDiskUsageLogPath); + } + m_DiskUsageLog.Open(m_Config.RootDirectory / "gc.dlog", CasLogFile::Mode::kWrite); m_DiskUsageLog.Initialize(); + const GcClock::Tick LastGCTick = m_LastGcTime.time_since_epoch().count(); m_DiskUsageLog.Replay( [this, LastGCTick](const DiskUsageWindow::DiskUsageEntry& Entry) { |