aboutsummaryrefslogtreecommitdiff
path: root/src/zenstore/gc.cpp
diff options
context:
space:
mode:
authorStefan Boberg <[email protected]>2026-01-07 13:53:27 +0100
committerGitHub Enterprise <[email protected]>2026-01-07 13:53:27 +0100
commit4d1da626ebf26af626c9df76bdfc8b6d0a81e430 (patch)
tree0f5e5be451cac287573e4ba3c5a3169c83f970fa /src/zenstore/gc.cpp
parentAdd base port getter and set the dll directory for plugin dependencies (#692) (diff)
downloadzen-4d1da626ebf26af626c9df76bdfc8b6d0a81e430.tar.xz
zen-4d1da626ebf26af626c9df76bdfc8b6d0a81e430.zip
added early-out check in GcManager::ScrubStorage(ScrubContext& GcCtx) (#698)
minimises time spent doing setup work after the deadline has expired also added log output with deadline/timeout information
Diffstat (limited to 'src/zenstore/gc.cpp')
-rw-r--r--src/zenstore/gc.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/zenstore/gc.cpp b/src/zenstore/gc.cpp
index f5b1577c9..14caa5abf 100644
--- a/src/zenstore/gc.cpp
+++ b/src/zenstore/gc.cpp
@@ -1565,6 +1565,8 @@ GcManager::ScrubStorage(ScrubContext& GcCtx)
for (GcStorage* Storage : m_GcStorage)
{
+ GcCtx.ThrowIfDeadlineExpired();
+
Storage->ScrubStorage(GcCtx);
}
}
@@ -2643,8 +2645,12 @@ GcScheduler::ScrubStorage(bool DoDelete, bool SkipCid, std::chrono::seconds Time
Deadline = std::chrono::steady_clock::time_point::max();
}
+ ZEN_INFO("scrubbing STARTING (delete mode => {}, skip CID => {}, max_duration = {})",
+ DoDelete,
+ SkipCid,
+ NiceTimeSpanMs(std::chrono::milliseconds(TimeSlice).count()));
+
Stopwatch Timer;
- ZEN_INFO("scrubbing STARTING (delete mode => {}, skip CID => {})", DoDelete, SkipCid);
WorkerThreadPool& ThreadPool = GetMediumWorkerPool(EWorkloadType::Background);
ScrubContext Ctx{ThreadPool, Deadline};