diff options
Diffstat (limited to 'src/zenserver/config.cpp')
| -rw-r--r-- | src/zenserver/config.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/zenserver/config.cpp b/src/zenserver/config.cpp index 6c2bf40d8..2023a9d51 100644 --- a/src/zenserver/config.cpp +++ b/src/zenserver/config.cpp @@ -165,6 +165,11 @@ ValidateOptions(ZenServerOptions& ServerOptions) { throw zen::OptionParseException("Dedicated server can not be used with forced local server address"); } + if (ServerOptions.GcConfig.AttachmentPassCount > ZenGcConfig::GcMaxAttachmentPassCount) + { + throw zen::OptionParseException( + fmt::format("GC attachment pass count can not be larger than {}", ZenGcConfig::GcMaxAttachmentPassCount)); + } } UpstreamCachePolicy @@ -524,6 +529,7 @@ ParseConfigFile(const std::filesystem::path& Path, LuaOptions.AddOption("gc.projectstore.attachment.store"sv, ServerOptions.ProjectStoreConfig.StoreAttachmentMetaData, "gc-projectstore-attachment-store"); + LuaOptions.AddOption("gc.attachment.passes"sv, ServerOptions.GcConfig.AttachmentPassCount, "gc-attachment-passes"sv); ////// gc LuaOptions.AddOption("gc.cache.maxdurationseconds"sv, ServerOptions.GcConfig.Cache.MaxDurationSeconds, "gc-cache-duration-seconds"sv); @@ -1015,6 +1021,14 @@ ParseCliOptions(int argc, char* argv[], ZenServerOptions& ServerOptions) cxxopts::value<bool>(ServerOptions.GcConfig.SingleThreaded)->default_value("false"), ""); + options.add_option("gc", + "", + "gc-attachment-passes", + "Limit the range of unreferenced attachments included in GC check by breaking it into passes. Default is one pass " + "which includes all the attachments.", + cxxopts::value<uint16_t>(ServerOptions.GcConfig.AttachmentPassCount)->default_value("1"), + ""); + options.add_option("objectstore", "", "objectstore-enabled", |