diff options
| author | Per Larsson <[email protected]> | 2021-12-10 07:35:28 +0100 |
|---|---|---|
| committer | Per Larsson <[email protected]> | 2021-12-10 07:35:28 +0100 |
| commit | 680d0a3b3c8e76762a0e8b19a94fd854429b91a6 (patch) | |
| tree | 483fa84d88086baeeec0bfb3782cfea7c3e1c3dd /zenstore/include | |
| parent | Ignore clangd cache directory. (diff) | |
| download | zen-680d0a3b3c8e76762a0e8b19a94fd854429b91a6.tar.xz zen-680d0a3b3c8e76762a0e8b19a94fd854429b91a6.zip | |
Set GC default enabled and interval set to zero (off).
Diffstat (limited to 'zenstore/include')
| -rw-r--r-- | zenstore/include/zenstore/gc.h | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/zenstore/include/zenstore/gc.h b/zenstore/include/zenstore/gc.h index 3c03c7feb..5a6afc8da 100644 --- a/zenstore/include/zenstore/gc.h +++ b/zenstore/include/zenstore/gc.h @@ -150,7 +150,7 @@ enum class GcSchedulerStatus : uint32_t struct GcSchedulerConfig { std::filesystem::path RootDirectory; - std::chrono::seconds Interval{3600}; + std::chrono::seconds Interval{}; std::chrono::seconds MaxCacheDuration{86400}; bool CollectSmallObjects = false; bool Enabled = false; @@ -158,9 +158,6 @@ struct GcSchedulerConfig class GcScheduler { - using Clock = std::chrono::system_clock; - using Timepoint = std::chrono::time_point<Clock>; - public: GcScheduler(CasGc& CasGc); ~GcScheduler(); @@ -171,13 +168,14 @@ public: void Shutdown(); private: - void SchedulerThread(); - spdlog::logger& Log() { return m_Log; } + void SchedulerThread(); + GcClock::TimePoint NextGcTime(GcClock::TimePoint CurrentTime); + spdlog::logger& Log() { return m_Log; } spdlog::logger& m_Log; CasGc& m_CasGc; GcSchedulerConfig m_Config; - Timepoint m_NextGcTime{}; + GcClock::TimePoint m_NextGcTime{}; std::atomic_uint32_t m_Status{}; std::jthread m_GcThread; std::mutex m_GcMutex; |