From ad7ae5a3724a2114f1fe9047097c7fc40a873a03 Mon Sep 17 00:00:00 2001 From: Grant Limberg Date: Wed, 27 May 2020 20:43:20 -0700 Subject: [PATCH] list of all network-node pairs --- controller/PostgreSQL.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/controller/PostgreSQL.cpp b/controller/PostgreSQL.cpp index 57e09ed6a..31573705d 100644 --- a/controller/PostgreSQL.cpp +++ b/controller/PostgreSQL.cpp @@ -1774,6 +1774,7 @@ void PostgreSQL::_doRedisUpdate(sw::redis::Transaction &tx, std::string &control {"last_updated", std::to_string(ts)} }; tx.zadd("nodes-online:{"+controllerId+"}", memberId, ts) + .zadd("nodes-online2:{"+controllerId+"}", networkId+"-"+memberId, ts) .zadd("network-nodes-online:{"+controllerId+"}:"+networkId, memberId, ts) .zadd("active-networks:{"+controllerId+"}", networkId, ts) .sadd("network-nodes-all:{"+controllerId+"}:"+networkId, memberId) @@ -1786,6 +1787,7 @@ void PostgreSQL::_doRedisUpdate(sw::redis::Transaction &tx, std::string &control uint64_t expireOld = OSUtils::now() - 300000; tx.zremrangebyscore("nodes-online:{"+controllerId+"}", sw::redis::RightBoundedInterval(expireOld, sw::redis::BoundType::LEFT_OPEN)); + tx.zremrangebyscore("nodes-online2:{"+controllerId+"}", sw::redis::RightBoundedInterval(expireOld, sw::redis::BoundType::LEFT_OPEN)); tx.zremrangebyscore("active-networks:{"+controllerId+"}", sw::redis::RightBoundedInterval(expireOld, sw::redis::BoundType::LEFT_OPEN)); { std::lock_guard l(_networks_l);