Browse Source

don't crash out of the controller heartbeat loop here

pull/4/head
Grant Limberg 4 years ago
parent
commit
9cf8dacfbb
No known key found for this signature in database
GPG Key ID: 8F2F97D3BE8D7735
  1. 14
      controller/PostgreSQL.cpp

14
controller/PostgreSQL.cpp

@ -1014,12 +1014,16 @@ void PostgreSQL::heartbeat()
}
_pool->unborrow(c);
if (_redisMemberStatus) {
if (_rc->clusterMode) {
_cluster->zadd("controllers", "controllerId", ts);
} else {
_redis->zadd("controllers", "controllerId", ts);
try {
if (_redisMemberStatus) {
if (_rc->clusterMode) {
_cluster->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));

Loading…
Cancel
Save