Skip to content

Commit

Permalink
Add an option to disable root index creation
Browse files Browse the repository at this point in the history
  • Loading branch information
lalinsky committed Feb 25, 2024
1 parent 33b8def commit 29f40cb
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/server/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<Options> opts(parser.parse(argc, argv));
Expand Down Expand Up @@ -144,6 +148,12 @@ int main(int argc, char **argv)
auto indexes = QSharedPointer<MultiIndex>::create(indexesDir);
auto metrics = QSharedPointer<Metrics>::create();

auto noRootIndex = opts->option("no-root-index");
if (noRootIndex == "NOT_SET") {
qDebug() << "Creating (legacy) root index";
indexes->createRootIndex();
}

Listener::setupSignalHandlers();

auto listener = QSharedPointer<Listener>::create(indexes->getRootIndex(true), metrics);
Expand Down

0 comments on commit 29f40cb

Please sign in to comment.