From f8d110ad0ebf43bbae18db5bef5c38f3c37f5234 Mon Sep 17 00:00:00 2001 From: Dan Engelbrecht Date: Wed, 1 Jun 2022 10:23:43 +0200 Subject: Make it possible to configure GC monitoring interval command line: --gc-monitor-interval-seconds lua: monitorintervalseconds --- zenserver/config.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'zenserver/config.cpp') diff --git a/zenserver/config.cpp b/zenserver/config.cpp index be91ae4f8..0775eb736 100644 --- a/zenserver/config.cpp +++ b/zenserver/config.cpp @@ -478,6 +478,13 @@ ParseCliOptions(int argc, char* argv[], ZenServerOptions& ServerOptions) "Size of gc disk reserve in bytes.", cxxopts::value(ServerOptions.GcConfig.DiskReserveSize)->default_value("268435456"), ""); + + options.add_option("gc", + "", + "gc-monitor-interval-seconds", + "Garbage collection interval in seconds. Default set to 0 (Off).", + cxxopts::value(ServerOptions.GcConfig.MonitorIntervalSeconds)->default_value("30"), + ""); try { auto result = options.parse(argc, argv); @@ -770,8 +777,9 @@ ParseConfigFile(const std::filesystem::path& Path, ZenServerOptions& ServerOptio if (sol::optional GcConfig = lua["gc"]) { - ServerOptions.GcConfig.IntervalSeconds = GcConfig.value().get_or("intervalseconds", 0); - ServerOptions.GcConfig.DiskReserveSize = GcConfig.value().get_or("diskreservesize", uint64_t(1u << 28)); + ServerOptions.GcConfig.MonitorIntervalSeconds = GcConfig.value().get_or("monitorintervalseconds", 30); + ServerOptions.GcConfig.IntervalSeconds = GcConfig.value().get_or("intervalseconds", 0); + ServerOptions.GcConfig.DiskReserveSize = GcConfig.value().get_or("diskreservesize", uint64_t(1u << 28)); if (sol::optional CacheGcConfig = GcConfig.value()["cache"]) { -- cgit v1.2.3 From faa5ce722c1d2621bab7cc840da5a9bfe8d04d5d Mon Sep 17 00:00:00 2001 From: Dan Engelbrecht Date: Wed, 1 Jun 2022 10:52:22 +0200 Subject: option description --- zenserver/config.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'zenserver/config.cpp') diff --git a/zenserver/config.cpp b/zenserver/config.cpp index 0775eb736..c534865dc 100644 --- a/zenserver/config.cpp +++ b/zenserver/config.cpp @@ -482,7 +482,7 @@ ParseCliOptions(int argc, char* argv[], ZenServerOptions& ServerOptions) options.add_option("gc", "", "gc-monitor-interval-seconds", - "Garbage collection interval in seconds. Default set to 0 (Off).", + "Garbage collection monitoring interval in seconds.", cxxopts::value(ServerOptions.GcConfig.MonitorIntervalSeconds)->default_value("30"), ""); try -- cgit v1.2.3