From eac140aa73ff6255f0d535fb1f7c82bc22e432c3 Mon Sep 17 00:00:00 2001 From: Grant Limberg Date: Mon, 2 Mar 2026 13:14:16 -0800 Subject: [PATCH] Update use of ztc_controller table for changes in progress in CV1. --- .gitignore | 3 +++ nonfree/controller/CV1.cpp | 8 ++++---- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index f5befd99f..0c92b5afc 100755 --- a/.gitignore +++ b/.gitignore @@ -141,3 +141,6 @@ __pycache__ *.pyc *_source.tar.bz2 snap/.snapcraft + +# local Claude configurations +.claude/*.local.* \ No newline at end of file diff --git a/nonfree/controller/CV1.cpp b/nonfree/controller/CV1.cpp index cf4496ad1..dfe8eece6 100644 --- a/nonfree/controller/CV1.cpp +++ b/nonfree/controller/CV1.cpp @@ -1130,22 +1130,22 @@ void CV1::heartbeat() std::string build = std::to_string(ZEROTIER_ONE_VERSION_BUILD); std::string now = std::to_string(ts); std::string host_port = std::to_string(_listenPort); - std::string use_redis = (_rc != NULL) ? "true" : "false"; + std::string notification_transport = (_rc != NULL) ? "redis" : "postgres"; std::string redis_mem_status = (_redisMemberStatus) ? "true" : "false"; try { pqxx::work w { *c->c }; pqxx::result res = w.exec0( - "INSERT INTO ztc_controller (id, cluster_host, last_alive, public_identity, v_major, v_minor, v_rev, v_build, host_port, use_redis, redis_member_status) " + "INSERT INTO ztc_controller (id, cluster_host, last_alive, public_identity, v_major, v_minor, v_rev, v_build, host_port, notification_transport, redis_member_status) " "VALUES (" + w.quote(controllerId) + ", " + w.quote(hostname) + ", TO_TIMESTAMP(" + now + "::double precision/1000), " + w.quote(publicIdentity) + ", " + major + ", " + minor + ", " + rev + ", " + build + ", " + host_port + ", " - + use_redis + ", " + redis_mem_status + + w.quote(notification_transport) + ", " + redis_mem_status + ") " "ON CONFLICT (id) DO UPDATE SET cluster_host = EXCLUDED.cluster_host, last_alive = EXCLUDED.last_alive, " "public_identity = EXCLUDED.public_identity, v_major = EXCLUDED.v_major, v_minor = EXCLUDED.v_minor, " "v_rev = EXCLUDED.v_rev, v_build = EXCLUDED.v_rev, host_port = EXCLUDED.host_port, " - "use_redis = EXCLUDED.use_redis, redis_member_status = EXCLUDED.redis_member_status"); + "notification_transport = EXCLUDED.notification_transport, redis_member_status = EXCLUDED.redis_member_status"); w.commit(); } catch (std::exception& e) {