println for which notification stream the controller is listening to

This commit is contained in:
Grant Limberg 2020-07-27 18:37:45 -07:00
parent 251b06d812
commit 5b700fa497
No known key found for this signature in database
GPG Key ID: 2BA62CCABBB4095A

View File

@ -795,6 +795,7 @@ void PostgreSQL::membersDbWatcher()
void PostgreSQL::_membersWatcher_Postgres(PGconn *conn) {
char buf[11] = {0};
std::string cmd = "LISTEN member_" + std::string(_myAddress.toString(buf));
fprintf(stderr, "Listening to member stream: %s\n", cmd.c_str());
PGresult *res = PQexec(conn, cmd.c_str());
if (!res || PQresultStatus(res) != PGRES_COMMAND_OK) {
fprintf(stderr, "LISTEN command failed: %s\n", PQresultErrorMessage(res));
@ -836,7 +837,7 @@ void PostgreSQL::_membersWatcher_Postgres(PGconn *conn) {
void PostgreSQL::_membersWatcher_Redis() {
char buf[11] = {0};
std::string key = "member-stream:{" + std::string(_myAddress.toString(buf)) + "}";
fprintf(stderr, "Listening to member stream: %s\n", key.c_str());
while (_run == 1) {
try {
json tmp;