diff --git a/src/raftCore/raft.cpp b/src/raftCore/raft.cpp index b227dfd..bd57ace 100644 --- a/src/raftCore/raft.cpp +++ b/src/raftCore/raft.cpp @@ -466,7 +466,6 @@ void Raft::InstallSnapshot(const raftRpcProctoc::InstallSnapshotRequest* args, msg.SnapshotTerm = args->lastsnapshotincludeterm(); msg.SnapshotIndex = args->lastsnapshotincludeindex(); - applyChan->Push(msg); std::thread t(&Raft::pushMsgToKvServer, this, msg); // 创建新线程并执行b函数,并传递参数 t.detach(); //看下这里能不能再优化 diff --git a/src/rpc/mprpcconfig.cpp b/src/rpc/mprpcconfig.cpp index c017eb5..22daa41 100644 --- a/src/rpc/mprpcconfig.cpp +++ b/src/rpc/mprpcconfig.cpp @@ -21,7 +21,7 @@ void MprpcConfig::LoadConfigFile(const char *config_file) { Trim(read_buf); // 判断#的注释 - if (read_buf[0] == '#' || read_buf.empty()) { + if (read_buf.empty() || read_buf[0] == '#') { continue; }