mirror of
https://github.com/zerotier/ZeroTierOne.git
synced 2025-05-06 02:28:23 +00:00
println for which notification stream the controller is listening to
This commit is contained in:
parent
251b06d812
commit
5b700fa497
@ -795,6 +795,7 @@ void PostgreSQL::membersDbWatcher()
|
|||||||
void PostgreSQL::_membersWatcher_Postgres(PGconn *conn) {
|
void PostgreSQL::_membersWatcher_Postgres(PGconn *conn) {
|
||||||
char buf[11] = {0};
|
char buf[11] = {0};
|
||||||
std::string cmd = "LISTEN member_" + std::string(_myAddress.toString(buf));
|
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());
|
PGresult *res = PQexec(conn, cmd.c_str());
|
||||||
if (!res || PQresultStatus(res) != PGRES_COMMAND_OK) {
|
if (!res || PQresultStatus(res) != PGRES_COMMAND_OK) {
|
||||||
fprintf(stderr, "LISTEN command failed: %s\n", PQresultErrorMessage(res));
|
fprintf(stderr, "LISTEN command failed: %s\n", PQresultErrorMessage(res));
|
||||||
@ -836,7 +837,7 @@ void PostgreSQL::_membersWatcher_Postgres(PGconn *conn) {
|
|||||||
void PostgreSQL::_membersWatcher_Redis() {
|
void PostgreSQL::_membersWatcher_Redis() {
|
||||||
char buf[11] = {0};
|
char buf[11] = {0};
|
||||||
std::string key = "member-stream:{" + std::string(_myAddress.toString(buf)) + "}";
|
std::string key = "member-stream:{" + std::string(_myAddress.toString(buf)) + "}";
|
||||||
|
fprintf(stderr, "Listening to member stream: %s\n", key.c_str());
|
||||||
while (_run == 1) {
|
while (_run == 1) {
|
||||||
try {
|
try {
|
||||||
json tmp;
|
json tmp;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user