summaryrefslogtreecommitdiff
path: root/controller/DBMirrorSet.cpp
diff options
context:
space:
mode:
authorAdam Ierymenko <[email protected]>2021-07-23 19:05:59 -0400
committerAdam Ierymenko <[email protected]>2021-07-23 19:05:59 -0400
commitefe0e8aa7bf5acbc604bff0906f5c212a2c4d81d (patch)
tree25e69543860616d28c076ec4f2467d1ff0f31832 /controller/DBMirrorSet.cpp
parent5c7e51feaf2dba254da48bb09587e3f5cf1893a2 (diff)
Notification of about-to-expire status... almost there.
Diffstat (limited to 'controller/DBMirrorSet.cpp')
-rw-r--r--controller/DBMirrorSet.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/controller/DBMirrorSet.cpp b/controller/DBMirrorSet.cpp
index fd508342..0bc16ce0 100644
--- a/controller/DBMirrorSet.cpp
+++ b/controller/DBMirrorSet.cpp
@@ -240,9 +240,9 @@ void DBMirrorSet::onNetworkMemberDeauthorize(const void *db,uint64_t networkId,u
_listener->onNetworkMemberDeauthorize(this,networkId,memberId);
}
-std::vector<std::pair<uint64_t, uint64_t>> DBMirrorSet::membersExpiringSoon()
+std::set< std::pair<uint64_t, uint64_t> > DBMirrorSet::membersExpiringSoon()
{
- std::vector<std::pair<uint64_t, uint64_t>> soon;
+ std::set< std::pair<uint64_t, uint64_t> > soon;
std::unique_lock<std::mutex> l(_membersExpiringSoon_l);
int64_t now = OSUtils::now();
for(auto next=_membersExpiringSoon.begin();next!=_membersExpiringSoon.end();) {
@@ -259,11 +259,11 @@ std::vector<std::pair<uint64_t, uint64_t>> DBMirrorSet::membersExpiringSoon()
const bool ssoExempt = member["ssoExempt"];
const int64_t authenticationExpiryTime = member["authenticationExpiryTime"];
if ((authenticationExpiryTime == next->first)&&(authorized)&&(!ssoExempt)) {
- if ((authenticationExpiryTime - now) > 10000) {
- // Stop when we get to entries more than 10s in the future.
+ if ((authenticationExpiryTime - now) > ZT_MEMBER_AUTH_TIMEOUT_NOTIFY_BEFORE) {
+ // Stop when we get to entries too far in the future.
break;
} else {
- soon.push_back(std::pair<uint64_t, uint64_t>(nwid, memberId));
+ soon.insert(std::pair<uint64_t, uint64_t>(nwid, memberId));
}
} else {
// Obsolete entry, no longer authorized, or SSO exempt.