This commit is contained in:
aozhiwei 2019-05-31 14:45:03 +08:00
parent bdc2534e0a
commit 7bbdcd419b

View File

@ -67,8 +67,9 @@ void JsonDataMgr::Init()
routing_tables_json_.ReadFromFile(routing_tables_json_file); routing_tables_json_.ReadFromFile(routing_tables_json_file);
node_host_mutex_->lock(); node_host_mutex_->lock();
for (int i = 0; i < routing_tables_json_.Size(); ++i) { for (int i = 0; i < routing_tables_json_.Size(); ++i) {
int node_id = routing_tables_json_.At("node_id")->AsXValue(); auto node_conf = routing_tables_json_.At(i);
std::string host = routing_tables_json_.At("host")->AsXValue(); int node_id = node_conf->At("node_id")->AsXValue();
std::string host = node_conf->At("host")->AsXValue();
if (node_host_hash_.find(node_id) != node_host_hash_.end()) { if (node_host_hash_.find(node_id) != node_host_hash_.end()) {
abort(); abort();
} }