From 3d69c577f686711d6ceea07ae3f479646ad22658 Mon Sep 17 00:00:00 2001 From: beanljun Date: Mon, 29 Jul 2024 21:55:21 +0800 Subject: [PATCH] =?UTF-8?q?raft=E8=B0=83=E7=94=A8InstallSnapshot=E5=AD=98?= =?UTF-8?q?=E5=9C=A8=E9=87=8D=E5=A4=8D=E7=9A=84=E9=97=AE=E9=A2=98=20#57?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/raftCore/raft.cpp | 1 - src/rpc/mprpcconfig.cpp | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) 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; }