diff options
| author | Dan Engelbrecht <[email protected]> | 2022-04-01 15:20:42 +0200 |
|---|---|---|
| committer | Dan Engelbrecht <[email protected]> | 2022-04-01 15:20:42 +0200 |
| commit | ef8cb5f11168183be77b1c121a9171b2ea9fbaab (patch) | |
| tree | fc9abc4f409ce05a6f290e9857659e72f6aee3f8 /zenserver/config.cpp | |
| parent | fix entry validation (diff) | |
| download | zen-ef8cb5f11168183be77b1c121a9171b2ea9fbaab.tar.xz zen-ef8cb5f11168183be77b1c121a9171b2ea9fbaab.zip | |
Make gc reserve a global resource
Diffstat (limited to 'zenserver/config.cpp')
| -rw-r--r-- | zenserver/config.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
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<int32_t>(ServerOptions.GcConfig.Cache.MaxDurationSeconds)->default_value("86400"), ""); + + options.add_option("gc", + "", + "disk-reserve-size", + "Size of gc disk reserve in bytes.", + cxxopts::value<uint64_t>(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<sol::table> 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<sol::table> CacheGcConfig = GcConfig.value()["cache"]) { |