summaryrefslogtreecommitdiff
path: root/controller/PostgreSQL.cpp
diff options
context:
space:
mode:
authorGrant Limberg <[email protected]>2023-08-29 12:19:28 -0700
committerGrant Limberg <[email protected]>2023-08-29 12:19:28 -0700
commitd865c42ef8fa76708fb739069b6ce97c79506dc5 (patch)
treeddc229cc20185bd0f96e116e18d0775c0427edc2 /controller/PostgreSQL.cpp
parent69c590ff8122bfafb696b4b76a27cd6bb4a546a7 (diff)
get connected to temporal
Diffstat (limited to 'controller/PostgreSQL.cpp')
-rw-r--r--controller/PostgreSQL.cpp17
1 files changed, 15 insertions, 2 deletions
diff --git a/controller/PostgreSQL.cpp b/controller/PostgreSQL.cpp
index 878c646b..5aa6d2c2 100644
--- a/controller/PostgreSQL.cpp
+++ b/controller/PostgreSQL.cpp
@@ -280,15 +280,21 @@ PostgreSQL::~PostgreSQL()
void PostgreSQL::configureSmee()
{
const char *TEMPORAL_HOST = "ZT_TEMPORAL_HOST";
+ const char *TEMPORAL_PORT = "ZT_TEMPORAL_PORT";
const char *TEMPORAL_NAMESPACE = "ZT_TEMPORAL_NAMESPACE";
const char *SMEE_TASK_QUEUE = "ZT_SMEE_TASK_QUEUE";
const char *host = getenv(TEMPORAL_HOST);
+ const char *port = getenv(TEMPORAL_PORT);
const char *ns = getenv(TEMPORAL_NAMESPACE);
const char *task_queue = getenv(SMEE_TASK_QUEUE);
- if (host != NULL && ns != NULL && task_queue != NULL) {
- this->_smee = smeeclient::smee_client_new(host, ns, task_queue);
+ if (host != NULL && port != NULL && ns != NULL && task_queue != NULL) {
+ fprintf(stderr, "creating smee client\n");
+ std::string hostPort = std::string(host) + std::string(":") + std::string(port);
+ this->_smee = smeeclient::smee_client_new(hostPort.c_str(), ns, task_queue);
+ } else {
+ fprintf(stderr, "Smee client not configured\n");
}
}
@@ -1426,6 +1432,13 @@ void PostgreSQL::commitThread()
if (_smee != NULL && isNewMember) {
notifyNewMember(networkId, memberId);
+ } else {
+ if (_smee == NULL) {
+ fprintf(stderr, "smee is NULL\n");
+ }
+ if (!isNewMember) {
+ fprintf(stderr, "nt a new member\n");
+ }
}
const uint64_t nwidInt = OSUtils::jsonIntHex(config["nwid"], 0ULL);