Grant Limberg 1 هفته پیش
والد
کامیت
282d7c7f9d
2فایلهای تغییر یافته به همراه4 افزوده شده و 14 حذف شده
  1. 4 0
      nonfree/controller/CentralDB.cpp
  2. 0 14
      nonfree/controller/PostgresStatusWriter.cpp

+ 4 - 0
nonfree/controller/CentralDB.cpp

@@ -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",

+ 0 - 14
nonfree/controller/PostgresStatusWriter.cpp

@@ -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 ('"