diff --git a/src/command_line.cc b/src/command_line.cc index a395f66f..3251564d 100644 --- a/src/command_line.cc +++ b/src/command_line.cc @@ -144,7 +144,13 @@ bool QueryDbMainLoop(Config* config, queue->for_querydb.DequeueAll(); bool did_work = messages.size(); for (auto& message : messages) { - QueryDb_Handle(message); + for (MessageHandler* handler : *MessageHandler::message_handlers) { + if (handler->GetId() == message->method_id) { + handler->Run(std::move(message)); + break; + } + } + if (message) { LOG_S(FATAL) << "Exiting; unhandled IPC message " << IpcIdToString(message->method_id); diff --git a/src/import_pipeline.cc b/src/import_pipeline.cc index 985e5c74..81fe7d1d 100644 --- a/src/import_pipeline.cc +++ b/src/import_pipeline.cc @@ -609,15 +609,6 @@ void Indexer_Main(Config* config, } } -void QueryDb_Handle(std::unique_ptr& message) { - for (MessageHandler* handler : *MessageHandler::message_handlers) { - if (handler->GetId() == message->method_id) { - handler->Run(std::move(message)); - break; - } - } -} - namespace { void QueryDb_DoIdMap(QueueManager* queue, QueryDatabase* db, diff --git a/src/import_pipeline.h b/src/import_pipeline.h index 19770def..81355a29 100644 --- a/src/import_pipeline.h +++ b/src/import_pipeline.h @@ -43,9 +43,6 @@ void Indexer_Main(Config* config, WorkingFiles* working_files, MultiQueueWaiter* waiter); -struct BaseIpcMessage; -void QueryDb_Handle(std::unique_ptr& message); - bool QueryDb_ImportMain(Config* config, QueryDatabase* db, ImportManager* import_manager,