mirror of
https://github.com/zerotier/ZeroTierOne.git
synced 2025-06-15 05:38:18 +00:00
bump online notification pause to 100ms
also put all online notification redis commands into a single tx
This commit is contained in:
@ -1590,7 +1590,7 @@ void PostgreSQL::onlineNotificationThread()
|
|||||||
fprintf(stderr, "Error in online notification thread (redis): %s\n", e.what());
|
fprintf(stderr, "Error in online notification thread (redis): %s\n", e.what());
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
std::this_thread::sleep_for(std::chrono::milliseconds(10));
|
std::this_thread::sleep_for(std::chrono::milliseconds(100));
|
||||||
}
|
}
|
||||||
|
|
||||||
fprintf(stderr, "%s: Fell out of run loop in onlineNotificationThread\n", _myAddressStr.c_str());
|
fprintf(stderr, "%s: Fell out of run loop in onlineNotificationThread\n", _myAddressStr.c_str());
|
||||||
@ -1705,7 +1705,7 @@ void PostgreSQL::onlineNotification_Postgres(PGconn *conn, std::unordered_map< s
|
|||||||
PQclear(res);
|
PQclear(res);
|
||||||
}
|
}
|
||||||
|
|
||||||
// std::this_thread::sleep_for(std::chrono::milliseconds(10));
|
// std::this_thread::sleep_for(std::chrono::milliseconds(100));
|
||||||
// }
|
// }
|
||||||
// fprintf(stderr, "%s: Fell out of run loop in onlineNotificationThread\n", _myAddressStr.c_str());
|
// fprintf(stderr, "%s: Fell out of run loop in onlineNotificationThread\n", _myAddressStr.c_str());
|
||||||
// PQfinish(conn);
|
// PQfinish(conn);
|
||||||
@ -1743,7 +1743,7 @@ void PostgreSQL::onlineNotification_Redis()
|
|||||||
fprintf(stderr, "Error in online notification thread (redis): %s\n", e.what());
|
fprintf(stderr, "Error in online notification thread (redis): %s\n", e.what());
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
std::this_thread::sleep_for(std::chrono::milliseconds(10));
|
std::this_thread::sleep_for(std::chrono::milliseconds(100));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1785,8 +1785,6 @@ void PostgreSQL::_doRedisUpdate(sw::redis::Transaction &tx, std::string &control
|
|||||||
.hmset("member:{"+controllerId+"}:"+networkId+":"+memberId, record.begin(), record.end());
|
.hmset("member:{"+controllerId+"}:"+networkId+":"+memberId, record.begin(), record.end());
|
||||||
}
|
}
|
||||||
|
|
||||||
tx.exec();
|
|
||||||
|
|
||||||
// expire records from all-nodes and network-nodes member list
|
// expire records from all-nodes and network-nodes member list
|
||||||
uint64_t expireOld = OSUtils::now() - 300000;
|
uint64_t expireOld = OSUtils::now() - 300000;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user