diff --git a/src/lib/service.cpp b/src/lib/service.cpp index a849e6f..b48ea58 100644 --- a/src/lib/service.cpp +++ b/src/lib/service.cpp @@ -208,15 +208,15 @@ bool msg_service::raftStep(const sisl::AsyncRpcDataPtr< Messaging, RaftGroupMsg, response.set_group_name(group_name); if (server) { /// TODO replace this ugly hack - //if (auto offload = _get_process_offload(request.group_type()); nullptr != offload) { - // offload([rpc_data, server]() { - // auto& request = rpc_data->request(); - // auto& response = rpc_data->response(); - // rpc_data->set_status(server->step(request.msg(), *response.mutable_msg())); - // rpc_data->send_response(); - // }); - // return false; - //} + // if (auto offload = _get_process_offload(request.group_type()); nullptr != offload) { + // offload([rpc_data, server]() { + // auto& request = rpc_data->request(); + // auto& response = rpc_data->response(); + // rpc_data->set_status(server->step(request.msg(), *response.mutable_msg())); + // rpc_data->send_response(); + // }); + // return false; + // } try { rpc_data->set_status(server->step(request.msg(), *response.mutable_msg())); return true; diff --git a/src/tests/MessagingTest.cpp b/src/tests/MessagingTest.cpp index 030e2cf..cf8f83a 100644 --- a/src/tests/MessagingTest.cpp +++ b/src/tests/MessagingTest.cpp @@ -48,7 +48,7 @@ constexpr auto elect_to_high = elect_to_low * 2; namespace nuraft_mesg { -class TestApplication : public MessagingApplication, std::enable_shared_from_this< TestApplication > { +class TestApplication : public MessagingApplication, public std::enable_shared_from_this< TestApplication > { public: std::string name_; uint32_t port_; @@ -81,7 +81,7 @@ class TestApplication : public MessagingApplication, std::enable_shared_from_thi params.server_uuid_ = id_; params.mesg_port_ = port_; params.default_group_type_ = "test_type"; - instance_ = init_messaging(params, shared_from_this(), false); + instance_ = init_messaging(params, weak_from_this(), false); auto r_params = nuraft::raft_params() .with_election_timeout_lower(elect_to_low) .with_election_timeout_upper(elect_to_high)