From d5f6f6b98e50aaef84d87784e98a0e322022289d Mon Sep 17 00:00:00 2001 From: Grant Limberg Date: Mon, 19 May 2025 10:37:52 -0700 Subject: [PATCH] fix sql statement --- controller/CV2.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/controller/CV2.cpp b/controller/CV2.cpp index 9d4cd02ba..d735f855d 100644 --- a/controller/CV2.cpp +++ b/controller/CV2.cpp @@ -995,8 +995,8 @@ void CV2::onlineNotificationThread() { std::string device_network_insert = "INSERT INTO network_memberships_ctl (device_id, network_id, last_seen, os, arch) " "VALUES ('"+w2.esc(memberId)+"', '"+w2.esc(networkId)+"', '"+w2.esc(record.dump())+"'::JSONB, " "'"+w2.esc(osArchSplit[0])+"', '"+w2.esc(osArchSplit[1])+"') " - "ON CONFLICT (device_id, network_id) DO UPDATE SET last_seen = last_seen || EXCLUDED.last_seen " - "os = EXCLUDED.os, arch = EXCLUDED.arch"; + "ON CONFLICT (device_id, network_id) DO UPDATE SET os = EXCLUDED.os, arch = EXCLUDED.arch, " + "last_seen = last_seen || EXCLUDED.last_seen"; pipe.insert(device_network_insert); Metrics::pgsql_node_checkin++;