Merge pull request #2165 from zerotier/network-check

check hooks are enabled before firing
This commit is contained in:
Grant Limberg 2023-11-20 08:16:10 -08:00 committed by GitHub
commit 663ed73768
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 23 additions and 7 deletions

View File

@ -1436,7 +1436,21 @@ void PostgreSQL::commitThread()
w.commit();
if (_smee != NULL && isNewMember) {
notifyNewMember(networkId, memberId);
pqxx::row row = w.exec_params1(
"SELECT "
" count(h.hook_id) "
"FROM "
" ztc_hook h "
" INNER JOIN ztc_org o ON o.org_id = h.org_id "
" INNER JOIN ztc_network n ON n.owner_id = o.owner_id "
" WHERE "
"n.id = $1 ",
networkId
);
int64_t hookCount = row[0].as<int64_t>();
if (hookCount > 0) {
notifyNewMember(networkId, memberId);
}
}
const uint64_t nwidInt = OSUtils::jsonIntHex(config["nwid"], 0ULL);

View File

@ -100,12 +100,14 @@ else
done
fi
echo "Waiting for temporal"
while ! nc -z ${ZT_TEMPORAL_HOST} ${ZT_TEMPORAL_PORT}; do
echo "waiting...";
sleep 1;
done
echo "Temporal is up"
if [ -n "$ZT_TEMPORAL_HOST" ] && [ -n "$ZT_TEMPORAL_PORT" ]; then
echo "waiting for temporal..."
while ! nc -z ${ZT_TEMPORAL_HOST} ${ZT_TEMPORAL_PORT}; do
echo "waiting...";
sleep 1;
done
echo "Temporal is up"
fi
export GLIBCXX_FORCE_NEW=1
export GLIBCPP_FORCE_NEW=1