diff options
| author | Matt Peters <[email protected]> | 2022-01-10 10:57:59 -0700 |
|---|---|---|
| committer | Matt Peters <[email protected]> | 2022-01-10 10:57:59 -0700 |
| commit | 4a12683b27adb31bde9eb8f7df3b9e9cc8ec680a (patch) | |
| tree | c8b2939d400dd4bccae73d2782b15c65d30db19d /zenstore/gc.cpp | |
| parent | Add WaitForQuiescence RPC (diff) | |
| parent | Two missing override keywords (diff) | |
| download | zen-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.cpp | 8 |
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 |