From 29f40cb4182a85f395dd6e20d89b2f03cf9b0f14 Mon Sep 17 00:00:00 2001 From: Lukas Lalinsky Date: Sun, 25 Feb 2024 19:21:58 +0100 Subject: [PATCH] Add an option to disable root index creation --- src/server/main.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/server/main.cpp b/src/server/main.cpp index b6db13f..c023c5d 100644 --- a/src/server/main.cpp +++ b/src/server/main.cpp @@ -117,6 +117,10 @@ int main(int argc, char **argv) .setHelp("use specific number of threads") .setDefaultValue("0"); + parser.addOption("no-root-index") + .setHelp("do not create the root index") + .setDefaultValue("NOT_SET"); + // clang-format on std::unique_ptr opts(parser.parse(argc, argv)); @@ -144,6 +148,12 @@ int main(int argc, char **argv) auto indexes = QSharedPointer::create(indexesDir); auto metrics = QSharedPointer::create(); + auto noRootIndex = opts->option("no-root-index"); + if (noRootIndex == "NOT_SET") { + qDebug() << "Creating (legacy) root index"; + indexes->createRootIndex(); + } + Listener::setupSignalHandlers(); auto listener = QSharedPointer::create(indexes->getRootIndex(true), metrics);