aboutsummaryrefslogtreecommitdiff
path: root/src/zen/cmds/admin_cmd.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/zen/cmds/admin_cmd.cpp')
-rw-r--r--src/zen/cmds/admin_cmd.cpp11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/zen/cmds/admin_cmd.cpp b/src/zen/cmds/admin_cmd.cpp
index 502d1e799..15e854796 100644
--- a/src/zen/cmds/admin_cmd.cpp
+++ b/src/zen/cmds/admin_cmd.cpp
@@ -21,6 +21,12 @@ ScrubCommand::ScrubCommand()
m_Options.add_option("", "n", "dry", "Dry run (do not delete any data)", cxxopts::value(m_DryRun), "<bool>");
m_Options.add_option("", "", "no-gc", "Do not perform GC after scrub pass", cxxopts::value(m_NoGc), "<bool>");
m_Options.add_option("", "", "no-cas", "Do not scrub CAS stores", cxxopts::value(m_NoCas), "<bool>");
+ m_Options.add_option("",
+ "",
+ "maxtimeslice",
+ "Number of second Scrub is allowed to run before stopping in seconds (default 300s)",
+ cxxopts::value(m_MaxTimeSliceSeconds),
+ "<maxtimeslice>");
}
ScrubCommand::~ScrubCommand() = default;
@@ -44,7 +50,10 @@ ScrubCommand::Run(const ZenCliOptions& GlobalOptions, int argc, char** argv)
HttpClient Http(m_HostName);
- HttpClient::KeyValueMap Params{{"skipdelete", ToString(m_DryRun)}, {"skipgc", ToString(m_NoGc)}, {"skipcid", ToString(m_NoCas)}};
+ HttpClient::KeyValueMap Params{{"skipdelete", ToString(m_DryRun)},
+ {"skipgc", ToString(m_NoGc)},
+ {"skipcid", ToString(m_NoCas)},
+ {"maxtimeslice", fmt::format("{}", m_MaxTimeSliceSeconds)}};
if (HttpClient::Response Response = Http.Post("/admin/scrub"sv, /* headers */ HttpClient::KeyValueMap{}, Params))
{