mirror of
https://github.com/zerotier/ZeroTierOne.git
synced 2025-06-05 20:13:44 +02:00
don't crash out of the controller heartbeat loop here
This commit is contained in:
parent
b5d7d71e1e
commit
9cf8dacfbb
1 changed files with 9 additions and 5 deletions
|
@ -1014,12 +1014,16 @@ void PostgreSQL::heartbeat()
|
||||||
}
|
}
|
||||||
_pool->unborrow(c);
|
_pool->unborrow(c);
|
||||||
|
|
||||||
if (_redisMemberStatus) {
|
try {
|
||||||
if (_rc->clusterMode) {
|
if (_redisMemberStatus) {
|
||||||
_cluster->zadd("controllers", "controllerId", ts);
|
if (_rc->clusterMode) {
|
||||||
} else {
|
_cluster->zadd("controllers", "controllerId", ts);
|
||||||
_redis->zadd("controllers", "controllerId", ts);
|
} else {
|
||||||
|
_redis->zadd("controllers", "controllerId", ts);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
} catch (sw::redis::Error &e) {
|
||||||
|
fprintf(stderr, "ERROR: Redis error in heartbeat thread: %s\n", e.what());
|
||||||
}
|
}
|
||||||
|
|
||||||
std::this_thread::sleep_for(std::chrono::milliseconds(1000));
|
std::this_thread::sleep_for(std::chrono::milliseconds(1000));
|
||||||
|
|
Loading…
Add table
Reference in a new issue