Error recovery for network & member stream watchers

This commit is contained in:
Grant Limberg 2020-05-20 11:42:51 -07:00
parent 0f17508cac
commit 8b8399efbc
No known key found for this signature in database
GPG Key ID: 2BA62CCABBB4095A

View File

@ -735,6 +735,7 @@ void PostgreSQL::_membersWatcher_Redis() {
std::string key = "member-stream:{" + std::string(_myAddress.toString(buf)) + "}";
while (_run == 1) {
try {
json tmp;
std::unordered_map<std::string, ItemStream> result;
if (_rc->clusterMode) {
@ -780,6 +781,9 @@ void PostgreSQL::_membersWatcher_Redis() {
}
}
}
} catch (sw::redis::Error &e) {
fprintf(stderr, "Error in Redis members watcher: %s\n", e.what());
}
}
fprintf(stderr, "membersWatcher ended\n");
}
@ -856,6 +860,7 @@ void PostgreSQL::_networksWatcher_Redis() {
std::string key = "network-stream:{" + std::string(_myAddress.toString(buf)) + "}";
while (_run == 1) {
try {
json tmp;
std::unordered_map<std::string, ItemStream> result;
if (_rc->clusterMode) {
@ -902,6 +907,9 @@ void PostgreSQL::_networksWatcher_Redis() {
}
}
}
} catch (sw::redis::Error &e) {
fprintf(stderr, "Error in Redis networks watcher: %s\n", e.what());
}
}
fprintf(stderr, "networksWatcher ended\n");
}