Commit 25cbf495 authored by TousakaRin's avatar TousakaRin

Remove unnecessary modifications and optimize code style

parent 4962beee
......@@ -158,10 +158,8 @@ void StatusService::default_method(::google::protobuf::RpcController* cntl_base,
if (mp->http_url) {
os << " @" << *mp->http_url;
}
if (NULL != mp->status &&
mp->status->max_concurrency() > 0) {
os << " current_max_concurrency="
<< mp->status->max_concurrency();
if (mp->status && mp->status->max_concurrency() > 0) {
os << " max_concurrency=" << mp->status->max_concurrency();
}
}
os << "</h4>\n";
......@@ -172,10 +170,8 @@ void StatusService::default_method(::google::protobuf::RpcController* cntl_base,
if (mp->http_url) {
os << " @" << *mp->http_url;
}
if (NULL != mp->status &&
mp->status->max_concurrency() > 0) {
os << " max_concurrency="
<< mp->status->max_concurrency();
if (mp->status && mp->status->max_concurrency() > 0) {
os << " max_concurrency=" << mp->status->max_concurrency();
}
}
os << '\n';
......
......@@ -222,8 +222,8 @@ void ProcessMongoRequest(InputMessageBase* msg_base) {
if (!ServerPrivateAccessor(server).AddConcurrency(&(mongo_done->cntl))) {
mongo_done->cntl.SetFailed(
ELIMIT, "Reached server's max_concurrency=%d",
static_cast<int>(server->options().max_concurrency));
ELIMIT, "Reached server's max_concurrency=%d",
static_cast<int>(server->options().max_concurrency));
break;
}
if (FLAGS_usercode_in_pthread && TooManyUserCode()) {
......
......@@ -294,8 +294,8 @@ void ProcessNsheadRequest(InputMessageBase* msg_base) {
}
if (!server_accessor.AddConcurrency(cntl)) {
cntl->SetFailed(
ELIMIT, "Reached server's max_concurrency=%d",
static_cast<int>(server->options().max_concurrency));
ELIMIT, "Reached server's max_concurrency=%d",
static_cast<int>(server->options().max_concurrency));
break;
}
if (FLAGS_usercode_in_pthread && TooManyUserCode()) {
......
......@@ -388,8 +388,8 @@ void ProcessSofaRequest(InputMessageBase* msg_base) {
if (!server_accessor.AddConcurrency(cntl.get())) {
cntl->SetFailed(
ELIMIT, "Reached server's max_concurrency=%d",
static_cast<int>(server->options().max_concurrency));
ELIMIT, "Reached server's max_concurrency=%d",
static_cast<int>(server->options().max_concurrency));
break;
}
if (FLAGS_usercode_in_pthread && TooManyUserCode()) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment