From 3259b5a7f90f374ea75af469f07a29020d6c9c2d Mon Sep 17 00:00:00 2001 From: Dan Engelbrecht Date: Mon, 2 Oct 2023 10:58:47 +0200 Subject: lightweight gc (#431) - Feature: Add lightweight GC that only removes items from cache/project store without cleaning up data referenced in Cid store - Add `skipcid` parameter to http endpoint `admin/gc`, defaults to "false" - Add `--skipcid` option to `zen gc` command, defaults to false - Add `--gc-lightweight-interval-seconds` option to zenserver --- src/zenserver/config.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/zenserver/config.cpp') diff --git a/src/zenserver/config.cpp b/src/zenserver/config.cpp index 64acdfe73..6daf7fe1c 100644 --- a/src/zenserver/config.cpp +++ b/src/zenserver/config.cpp @@ -920,6 +920,9 @@ ParseConfigFile(const std::filesystem::path& Path, LuaOptions.AddOption("gc.lowdiskspacethreshold"sv, ServerOptions.GcConfig.MinimumFreeDiskSpaceToAllowWrites, "gc-low-diskspace-threshold"sv); + LuaOptions.AddOption("gc.lightweightntervalseconds"sv, + ServerOptions.GcConfig.LightweightIntervalSeconds, + "gc-lightweight-interval-seconds"sv); ////// gc LuaOptions.AddOption("gc.cache.maxdurationseconds"sv, ServerOptions.GcConfig.Cache.MaxDurationSeconds, "gc-cache-duration-seconds"sv); @@ -1356,6 +1359,13 @@ ParseCliOptions(int argc, char* argv[], ZenServerOptions& ServerOptions) cxxopts::value(ServerOptions.GcConfig.IntervalSeconds)->default_value("3600"), ""); + options.add_option("gc", + "", + "gc-lightweight-interval-seconds", + "Lightweight garbage collection interval in seconds. Default set to 900 (30 min).", + cxxopts::value(ServerOptions.GcConfig.LightweightIntervalSeconds)->default_value("900"), + ""); + options.add_option("gc", "", "gc-cache-duration-seconds", -- cgit v1.2.3