diff options
| author | Per Larsson <[email protected]> | 2022-01-05 10:05:13 +0100 |
|---|---|---|
| committer | Per Larsson <[email protected]> | 2022-01-05 10:05:13 +0100 |
| commit | f14c244b19cce65478eb8f2367d4900756848489 (patch) | |
| tree | 4e80749767f2c33bd1c0858c232634f1b7ed7046 /zenserver/config.cpp | |
| parent | Fix issues with deployment python script due to removal of sln files. (diff) | |
| download | zen-f14c244b19cce65478eb8f2367d4900756848489.tar.xz zen-f14c244b19cce65478eb8f2367d4900756848489.zip | |
Support GC configuration from LUA.
Diffstat (limited to 'zenserver/config.cpp')
| -rw-r--r-- | zenserver/config.cpp | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/zenserver/config.cpp b/zenserver/config.cpp index c33fcfebc..722bc3b97 100644 --- a/zenserver/config.cpp +++ b/zenserver/config.cpp @@ -561,5 +561,24 @@ 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); + + if (sol::optional<sol::table> CacheGcConfig = GcConfig.value()["cache"]) + { + ServerOptions.GcConfig.Cache.MaxDurationSeconds = CacheGcConfig.value().get_or("maxdurationseconds", int32_t(0)); + ServerOptions.GcConfig.Cache.DiskSizeLimit = CacheGcConfig.value().get_or("disksizelimit", ~uint64_t(0)); + ServerOptions.GcConfig.Cache.MemorySizeLimit = CacheGcConfig.value().get_or("memorysizelimit", ~uint64_t(0)); + } + + if (sol::optional<sol::table> CasGcConfig = GcConfig.value()["cas"]) + { + ServerOptions.GcConfig.Cas.LargeStrategySizeLimit = CasGcConfig.value().get_or("largestrategysizelimit", ~uint64_t(0)); + ServerOptions.GcConfig.Cas.SmallStrategySizeLimit = CasGcConfig.value().get_or("smallstrategysizelimit", ~uint64_t(0)); + ServerOptions.GcConfig.Cas.TinyStrategySizeLimit = CasGcConfig.value().get_or("tinystrategysizelimit", ~uint64_t(0)); + } + } } } |