mirror of
https://github.com/zerotier/ZeroTierOne.git
synced 2025-06-05 17:01:54 +00:00
Revert "remove redundant writes when changes come from Central"
This reverts commit f9396f979f82f39424dc36b2e81d52d0e00464e0.
This commit is contained in:
parent
f9396f979f
commit
c80843e496
@ -1078,10 +1078,6 @@ void PostgreSQL::commitThread()
|
|||||||
const std::string objtype = (*config)["objtype"];
|
const std::string objtype = (*config)["objtype"];
|
||||||
if (objtype == "member") {
|
if (objtype == "member") {
|
||||||
try {
|
try {
|
||||||
bool fromCentral = OSUtils::jsonBool((*config)["fromCentral"], false);
|
|
||||||
if (!fromCentral) {
|
|
||||||
// Central already writes all of this to the DB on a change.
|
|
||||||
// No need for the controller to do it as well.
|
|
||||||
std::string memberId = (*config)["id"];
|
std::string memberId = (*config)["id"];
|
||||||
std::string networkId = (*config)["nwid"];
|
std::string networkId = (*config)["nwid"];
|
||||||
std::string identity = (*config)["identity"];
|
std::string identity = (*config)["identity"];
|
||||||
@ -1237,7 +1233,6 @@ void PostgreSQL::commitThread()
|
|||||||
config = nullptr;
|
config = nullptr;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
const uint64_t nwidInt = OSUtils::jsonIntHex((*config)["nwid"], 0ULL);
|
const uint64_t nwidInt = OSUtils::jsonIntHex((*config)["nwid"], 0ULL);
|
||||||
const uint64_t memberidInt = OSUtils::jsonIntHex((*config)["id"], 0ULL);
|
const uint64_t memberidInt = OSUtils::jsonIntHex((*config)["id"], 0ULL);
|
||||||
@ -1259,8 +1254,6 @@ void PostgreSQL::commitThread()
|
|||||||
}
|
}
|
||||||
} else if (objtype == "network") {
|
} else if (objtype == "network") {
|
||||||
try {
|
try {
|
||||||
bool fromCentral = OSUtils::jsonBool((*config)["fromCentral"], false);
|
|
||||||
if (!fromCentral) {
|
|
||||||
std::string id = (*config)["id"];
|
std::string id = (*config)["id"];
|
||||||
std::string controllerId = _myAddressStr.c_str();
|
std::string controllerId = _myAddressStr.c_str();
|
||||||
std::string name = (*config)["name"];
|
std::string name = (*config)["name"];
|
||||||
@ -1526,7 +1519,6 @@ void PostgreSQL::commitThread()
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
PQclear(res);
|
PQclear(res);
|
||||||
}
|
|
||||||
|
|
||||||
const uint64_t nwidInt = OSUtils::jsonIntHex((*config)["nwid"], 0ULL);
|
const uint64_t nwidInt = OSUtils::jsonIntHex((*config)["nwid"], 0ULL);
|
||||||
if (nwidInt) {
|
if (nwidInt) {
|
||||||
@ -1647,7 +1639,7 @@ void PostgreSQL::commitThread()
|
|||||||
fprintf(stderr, "ERROR: Error getting objtype: %s\n", e.what());
|
fprintf(stderr, "ERROR: Error getting objtype: %s\n", e.what());
|
||||||
}
|
}
|
||||||
|
|
||||||
std::this_thread::sleep_for(std::chrono::milliseconds(1));
|
std::this_thread::sleep_for(std::chrono::milliseconds(100));
|
||||||
}
|
}
|
||||||
|
|
||||||
PQfinish(conn);
|
PQfinish(conn);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user