wwbmmm commented on code in PR #2123:
URL: https://github.com/apache/brpc/pull/2123#discussion_r1103970648
##########
src/brpc/periodic_naming_service.cpp:
##########
@@ -37,9 +37,13 @@ int PeriodicNamingService::RunNamingService(
const char* service_name, NamingServiceActions* actions) {
std::vector<ServerNode> servers;
bool ever_reset = false;
- for (;;) {
+ while (true) {
servers.clear();
const int rc = GetServers(service_name, &servers);
+ if (bthread_stopped(bthread_self())) {
Review Comment:
这个放在57行的位置会不会更合适
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]