mirror of
https://github.com/zerotier/ZeroTierOne.git
synced 2025-06-15 21:58:21 +00:00
handle case of no networks and/or no members
This commit is contained in:
@ -437,6 +437,7 @@ void PostgreSQL::initializeNetworks(PGconn *conn)
|
|||||||
|
|
||||||
PQclear(res);
|
PQclear(res);
|
||||||
|
|
||||||
|
if(!networkSet.empty()) {
|
||||||
if (_rc && _rc->clusterMode) {
|
if (_rc && _rc->clusterMode) {
|
||||||
auto tx = _cluster->transaction(_myAddressStr, true);
|
auto tx = _cluster->transaction(_myAddressStr, true);
|
||||||
tx.sadd(setKey, networkSet.begin(), networkSet.end());
|
tx.sadd(setKey, networkSet.begin(), networkSet.end());
|
||||||
@ -446,6 +447,7 @@ void PostgreSQL::initializeNetworks(PGconn *conn)
|
|||||||
tx.sadd(setKey, networkSet.begin(), networkSet.end());
|
tx.sadd(setKey, networkSet.begin(), networkSet.end());
|
||||||
tx.exec();
|
tx.exec();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (++this->_ready == 2) {
|
if (++this->_ready == 2) {
|
||||||
if (_waitNoticePrinted) {
|
if (_waitNoticePrinted) {
|
||||||
@ -643,6 +645,7 @@ void PostgreSQL::initializeMembers(PGconn *conn)
|
|||||||
|
|
||||||
PQclear(res);
|
PQclear(res);
|
||||||
|
|
||||||
|
if (!networkMembers.empty()) {
|
||||||
if (_rc != NULL) {
|
if (_rc != NULL) {
|
||||||
if (_rc->clusterMode) {
|
if (_rc->clusterMode) {
|
||||||
auto tx = _cluster->transaction(_myAddressStr, true);
|
auto tx = _cluster->transaction(_myAddressStr, true);
|
||||||
@ -658,6 +661,7 @@ void PostgreSQL::initializeMembers(PGconn *conn)
|
|||||||
tx.exec();
|
tx.exec();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
if (++this->_ready == 2) {
|
if (++this->_ready == 2) {
|
||||||
if (_waitNoticePrinted) {
|
if (_waitNoticePrinted) {
|
||||||
fprintf(stderr,"[%s] NOTICE: %.10llx controller PostgreSQL data download complete." ZT_EOL_S,_timestr(),(unsigned long long)_myAddress.toInt());
|
fprintf(stderr,"[%s] NOTICE: %.10llx controller PostgreSQL data download complete." ZT_EOL_S,_timestr(),(unsigned long long)_myAddress.toInt());
|
||||||
|
Reference in New Issue
Block a user