mirror of
https://github.com/zerotier/ZeroTierOne.git
synced 2025-04-17 20:46:54 +02:00
keep list of active networks in redis
This commit is contained in:
parent
13929aee6f
commit
fb0e8aebdb
1 changed files with 2 additions and 1 deletions
|
@ -1714,6 +1714,7 @@ void PostgreSQL::_doRedisUpdate(sw::redis::Transaction &tx, std::string &control
|
|||
};
|
||||
tx.zadd("nodes-online:{"+controllerId+"}", memberId, ts)
|
||||
.zadd("network-nodes-online:{"+controllerId+"}:"+networkId, memberId, ts)
|
||||
.zadd("active-networks:{"+controllerId+"}", networkId, ts)
|
||||
.sadd("network-nodes-all:{"+controllerId+"}:"+networkId, memberId)
|
||||
.hmset("member:{"+controllerId+"}:"+networkId+":"+memberId, record.begin(), record.end());
|
||||
}
|
||||
|
@ -1745,7 +1746,7 @@ void PostgreSQL::_doRedisUpdate(sw::redis::Transaction &tx, std::string &control
|
|||
}
|
||||
|
||||
tx.zremrangebyscore("nodes-online:{"+controllerId+"}", sw::redis::RightBoundedInterval<double>(expireOld, sw::redis::BoundType::LEFT_OPEN));
|
||||
|
||||
tx.zremrangebyscore("active-networks:{"+controllerId}"}", sw::redis::RightBoundedInterval<double>(expireOld, sw::redis::BoundType::LEFT_OPEN));
|
||||
for(const auto &k : keys) {
|
||||
tx.zremrangebyscore(k, sw::redis::RightBoundedInterval<double>(expireOld, sw::redis::BoundType::LEFT_OPEN));
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue