Remove QueryDb_Handle

Code is harder to read and it doesn't belong in import_pipeline.cc.
This commit is contained in:
Jacob Dufault 2018-02-11 14:31:17 -08:00
parent 95872d36fd
commit 1d98797f26
3 changed files with 7 additions and 13 deletions

View File

@ -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);

View File

@ -609,15 +609,6 @@ void Indexer_Main(Config* config,
}
}
void QueryDb_Handle(std::unique_ptr<BaseIpcMessage>& 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,

View File

@ -43,9 +43,6 @@ void Indexer_Main(Config* config,
WorkingFiles* working_files,
MultiQueueWaiter* waiter);
struct BaseIpcMessage;
void QueryDb_Handle(std::unique_ptr<BaseIpcMessage>& message);
bool QueryDb_ImportMain(Config* config,
QueryDatabase* db,
ImportManager* import_manager,