another fix
Some checks are pending
/ build_macos (push) Waiting to run
/ build_windows (push) Waiting to run
/ Central Controller Build (push) Waiting to run
/ multi-arch-docker (push) Blocked by required conditions
/ build_ubuntu (push) Waiting to run

This commit is contained in:
Grant Limberg 2025-09-04 17:45:38 -07:00
parent 48ff61b392
commit 282d7c7f9d
2 changed files with 4 additions and 14 deletions

View file

@ -1442,6 +1442,10 @@ void CentralDB::onlineNotificationThread()
std::string memberId(memTmp);
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(
"SELECT device_id, network_id FROM network_memberships_ctl WHERE network_id = $1 AND device_id "
"= $2",

View file

@ -57,20 +57,6 @@ void PostgresStatusWriter::writePending()
{ 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 =
"INSERT INTO network_memberships_ctl (device_id, network_id, last_seen, os, arch) "
"VALUES ('"