diff options
author | yang-g <yangg@google.com> | 2016-12-02 21:28:43 -0800 |
---|---|---|
committer | yang-g <yangg@google.com> | 2016-12-27 15:37:59 -0800 |
commit | 08137362d0c27d9908d91333c2825f09b30bad2b (patch) | |
tree | 6958d42982ee8430ffbde57ea234af23ad62451f /src/cpp | |
parent | 8d668d8324c3aa24353b3774a8f6ce35edbf20b7 (diff) |
WIP
Diffstat (limited to 'src/cpp')
-rw-r--r-- | src/cpp/server/server_cc.cc | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/cpp/server/server_cc.cc b/src/cpp/server/server_cc.cc index 037da2b301..5d4da92f2b 100644 --- a/src/cpp/server/server_cc.cc +++ b/src/cpp/server/server_cc.cc @@ -52,6 +52,7 @@ #include <grpc/support/log.h> #include "src/core/lib/profiling/timers.h" +#include "src/cpp/server/default_health_check_service.h" #include "src/cpp/thread_manager/thread_manager.h" namespace grpc { @@ -306,6 +307,15 @@ class Server::SyncRequestThreadManager : public ThreadManager { sync_requests_.emplace_back(new SyncRequest(method, tag)); } + void AddHealthCheckSyncMethod() { + if (!sync_requests_.empty()) { + health_check_.reset( + new RpcServiceMethod("???", RpcMethod::NORMAL_RPC, new XXXHandler)); + sync_requests_.emplace_back( + new SyncRequest(health_check_.get(), nullptr)); + } + } + void AddUnknownSyncMethod() { if (!sync_requests_.empty()) { unknown_method_.reset(new RpcServiceMethod( @@ -500,7 +510,7 @@ bool Server::Start(ServerCompletionQueue** cqs, size_t num_cqs) { // explicit one. if (health_check_service_ == nullptr && !health_check_service_disabled_ && EnableDefaultHealthCheckService()) { - health_check_service_.reset(CreateDefaultHealthCheckService()); + health_check_service_.reset(new DefaultHealthCheckService); for (auto it = sync_req_mgrs_.begin(); it != sync_req_mgrs_.end(); it++) { (*it)->AddHealthCheckSyncMethod(); } |