mirror of
https://github.com/zerotier/ZeroTierOne.git
synced 2025-09-17 04:03:00 +02:00
another fix
This commit is contained in:
parent
48ff61b392
commit
282d7c7f9d
2 changed files with 4 additions and 14 deletions
|
@ -1442,6 +1442,10 @@ void CentralDB::onlineNotificationThread()
|
||||||
std::string memberId(memTmp);
|
std::string memberId(memTmp);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
// check if the member exists first.
|
||||||
|
//
|
||||||
|
// exec_params1 will throw pqxx::unexpected_rows if not exactly one row is returned. If that's the
|
||||||
|
// case, skip this record and move on.
|
||||||
pqxx::row r = w.exec_params1(
|
pqxx::row r = w.exec_params1(
|
||||||
"SELECT device_id, network_id FROM network_memberships_ctl WHERE network_id = $1 AND device_id "
|
"SELECT device_id, network_id FROM network_memberships_ctl WHERE network_id = $1 AND device_id "
|
||||||
"= $2",
|
"= $2",
|
||||||
|
|
|
@ -57,20 +57,6 @@ void PostgresStatusWriter::writePending()
|
||||||
{ entry.address.toIpString(iptmp), entry.last_seen },
|
{ entry.address.toIpString(iptmp), entry.last_seen },
|
||||||
};
|
};
|
||||||
|
|
||||||
try {
|
|
||||||
// check if the member exists first.
|
|
||||||
//
|
|
||||||
// exec_params1 will throw pqxx::unexpected_rows if not exactly one row is returned. If that's the
|
|
||||||
// case, skip this record and move on.
|
|
||||||
w.exec_params1(
|
|
||||||
"SELECT device_id, network_id FROM network_memberships_ctl WHERE network_id = $1 AND device_id = "
|
|
||||||
"$2",
|
|
||||||
entry.network_id, entry.node_id);
|
|
||||||
}
|
|
||||||
catch (pqxx::unexpected_rows& e) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
std::string insert_statement =
|
std::string insert_statement =
|
||||||
"INSERT INTO network_memberships_ctl (device_id, network_id, last_seen, os, arch) "
|
"INSERT INTO network_memberships_ctl (device_id, network_id, last_seen, os, arch) "
|
||||||
"VALUES ('"
|
"VALUES ('"
|
||||||
|
|
Loading…
Add table
Reference in a new issue