aboutsummaryrefslogtreecommitdiff
path: root/zenstore/gc.cpp
diff options
context:
space:
mode:
authorMatt Peters <[email protected]>2022-01-10 10:57:59 -0700
committerMatt Peters <[email protected]>2022-01-10 10:57:59 -0700
commit4a12683b27adb31bde9eb8f7df3b9e9cc8ec680a (patch)
treec8b2939d400dd4bccae73d2782b15c65d30db19d /zenstore/gc.cpp
parentAdd WaitForQuiescence RPC (diff)
parentTwo missing override keywords (diff)
downloadzen-wait_for_quiescence.tar.xz
zen-wait_for_quiescence.zip
Merge branch 'main' into wait_for_quiescencewait_for_quiescence
Diffstat (limited to 'zenstore/gc.cpp')
-rw-r--r--zenstore/gc.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/zenstore/gc.cpp b/zenstore/gc.cpp
index d23e0c466..0e93f1c3d 100644
--- a/zenstore/gc.cpp
+++ b/zenstore/gc.cpp
@@ -393,7 +393,7 @@ GcScheduler::Initialize(const GcSchedulerConfig& Config)
}
m_NextGcTime = NextGcTime(m_LastGcTime);
- m_GcThread = std::jthread(&GcScheduler::SchedulerThread, this);
+ m_GcThread = std::thread(&GcScheduler::SchedulerThread, this);
}
void
@@ -403,6 +403,8 @@ GcScheduler::Shutdown()
{
m_Status = static_cast<uint32_t>(GcSchedulerStatus::kStopped);
m_GcSignal.notify_one();
+
+ m_GcThread.join();
}
}
@@ -427,8 +429,6 @@ GcScheduler::Trigger(const GcScheduler::TriggerParams& Params)
void
GcScheduler::SchedulerThread()
{
- using namespace fmt::literals;
-
std::chrono::seconds WaitTime = m_Config.MonitorInterval;
for (;;)
@@ -472,7 +472,7 @@ GcScheduler::SchedulerThread()
NiceBytes(Space.Free),
NiceBytes(Space.Total),
m_Config.Interval.count()
- ? "{} until next GC"_format(NiceTimeSpanMs(uint64_t(std::chrono::milliseconds(RemaingTime).count())))
+ ? fmt::format("{} until next GC", NiceTimeSpanMs(uint64_t(std::chrono::milliseconds(RemaingTime).count())))
: std::string("next scheduled GC no set"));
// TODO: Trigger GC if max disk usage water mark is reached