mirror of
https://github.com/MaskRay/ccls.git
synced 2025-01-31 18:00:26 +00:00
Make IpcId::Exit handled as a message.
This commit is contained in:
parent
07c0ae109e
commit
905a4ab2b1
@ -1250,12 +1250,6 @@ bool QueryDbMainLoop(Config* config,
|
||||
// FIXME: assert(!message), ie, verify that a handler was run.
|
||||
|
||||
switch (message->method_id) {
|
||||
case IpcId::Exit: {
|
||||
LOG_S(INFO) << "Exiting; got IpcId::Exit";
|
||||
exit(0);
|
||||
break;
|
||||
}
|
||||
|
||||
case IpcId::CqueryFreshenIndex: {
|
||||
LOG_S(INFO) << "Freshening " << project->entries.size() << " files";
|
||||
|
||||
|
13
src/messages/exit.cc
Normal file
13
src/messages/exit.cc
Normal file
@ -0,0 +1,13 @@
|
||||
#include "message_handler.h"
|
||||
|
||||
#include <loguru.hpp>
|
||||
|
||||
struct ExitHandler : MessageHandler {
|
||||
IpcId GetId() const override { return IpcId::Exit; }
|
||||
|
||||
void Run(std::unique_ptr<BaseIpcMessage> request) override {
|
||||
LOG_S(INFO) << "Exiting; got IpcId::Exit";
|
||||
exit(0);
|
||||
}
|
||||
};
|
||||
REGISTER_MESSAGE_HANDLER(ExitHandler);
|
Loading…
Reference in New Issue
Block a user