diff options
Diffstat (limited to 'zenserver/config.cpp')
| -rw-r--r-- | zenserver/config.cpp | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/zenserver/config.cpp b/zenserver/config.cpp index 6d725e55b..6e8b48703 100644 --- a/zenserver/config.cpp +++ b/zenserver/config.cpp @@ -95,6 +95,12 @@ ParseGlobalCliOptions(int argc, char* argv[], ZenServerOptions& GlobalOptions, Z cxxopts::value<bool>(ServiceConfig.ShouldCrash)->default_value("false"), ""); + options.add_option("cache", + "", + "enable-upstream-cache", + "Whether upstream caching is enabled", + cxxopts::value<bool>(ServiceConfig.UpstreamCacheEnabled)->default_value("false"), + ""); try { auto result = options.parse(argc, argv); @@ -164,9 +170,11 @@ ParseServiceConfig(const std::filesystem::path& DataRoot, ZenServiceConfig& Serv throw std::exception("fatal zen global config script ({}) failure: {}"_format(ConfigScript, e.what()).c_str()); } - ServiceConfig.LegacyCacheEnabled = lua["legacycache"]["enable"]; - const std::string path = lua["legacycache"]["readpath"]; - ServiceConfig.StructuredCacheEnabled = lua["structuredcache"]["enable"]; - ServiceConfig.MeshEnabled = lua["mesh"]["enable"]; + + ServiceConfig.LegacyCacheEnabled = lua["legacycache"]["enable"].get_or(ServiceConfig.LegacyCacheEnabled); + const std::string path = lua["legacycache"]["readpath"].get_or(std::string()); + ServiceConfig.StructuredCacheEnabled = lua["structuredcache"]["enable"].get_or(ServiceConfig.StructuredCacheEnabled); + ServiceConfig.MeshEnabled = lua["mesh"]["enable"].get_or(ServiceConfig.MeshEnabled); + ServiceConfig.UpstreamCacheEnabled = lua["structuredcache"]["upstream"]["enable"].get_or(ServiceConfig.UpstreamCacheEnabled); } } |