From ef8cb5f11168183be77b1c121a9171b2ea9fbaab Mon Sep 17 00:00:00 2001 From: Dan Engelbrecht Date: Fri, 1 Apr 2022 15:20:42 +0200 Subject: Make gc reserve a global resource --- zenserver/config.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'zenserver/config.cpp') diff --git a/zenserver/config.cpp b/zenserver/config.cpp index b7fc18b4e..ac0f863cc 100644 --- a/zenserver/config.cpp +++ b/zenserver/config.cpp @@ -428,6 +428,13 @@ ParseCliOptions(int argc, char* argv[], ZenServerOptions& ServerOptions) "Max duration in seconds before Z$ entries get evicted.", cxxopts::value(ServerOptions.GcConfig.Cache.MaxDurationSeconds)->default_value("86400"), ""); + + options.add_option("gc", + "", + "disk-reserve-size", + "Size of gc disk reserve in bytes.", + cxxopts::value(ServerOptions.GcConfig.DiskReserveSize)->default_value("268435456"), + ""); try { auto result = options.parse(argc, argv); @@ -699,6 +706,7 @@ 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)); if (sol::optional CacheGcConfig = GcConfig.value()["cache"]) { -- cgit v1.2.3