summaryrefslogtreecommitdiff
path: root/controller/RethinkDB.cpp
diff options
context:
space:
mode:
authorAdam Ierymenko <adam.ierymenko@gmail.com>2017-11-03 12:32:56 -0700
committerAdam Ierymenko <adam.ierymenko@gmail.com>2017-11-03 12:32:56 -0700
commitd97adc8789c2a38d0106c83b0f02522f9cf0d7dd (patch)
tree6cbb85d0f6e36e34f593a49c7d1f7c516e809a38 /controller/RethinkDB.cpp
parentf5014d7d7179a77311f58f8bd0dced0ea83f2885 (diff)
downloadinfinitytier-d97adc8789c2a38d0106c83b0f02522f9cf0d7dd.tar.gz
infinitytier-d97adc8789c2a38d0106c83b0f02522f9cf0d7dd.zip
Preparing for test.
Diffstat (limited to 'controller/RethinkDB.cpp')
-rw-r--r--controller/RethinkDB.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/controller/RethinkDB.cpp b/controller/RethinkDB.cpp
index 2d28dab2..ec6aae4e 100644
--- a/controller/RethinkDB.cpp
+++ b/controller/RethinkDB.cpp
@@ -164,6 +164,9 @@ RethinkDB::RethinkDB(EmbeddedNetworkController *const nc,const Address &myAddres
const std::string tmp = (*config)["id"];
deleteId.append(tmp);
table = "Member";
+ } else if (objtype == "trace") {
+ record = *config;
+ table = "RemoteTrace";
} else {
continue;
}
@@ -452,6 +455,21 @@ void RethinkDB::_memberChanged(nlohmann::json &old,nlohmann::json &member)
_controller->onNetworkMemberUpdate(networkId,memberId);
}
+ } else if (memberId) {
+ if (nw) {
+ std::lock_guard<std::mutex> l(nw->lock);
+ nw->members.erase(memberId);
+ }
+ if (networkId) {
+ std::lock_guard<std::mutex> l(_networks_l);
+ auto er = _networkByMember.equal_range(memberId);
+ for(auto i=er.first;i!=er.second;++i) {
+ if (i->second == networkId) {
+ _networkByMember.erase(i);
+ break;
+ }
+ }
+ }
}
if ((wasAuth)&&(!isAuth)&&(networkId)&&(memberId))