Browse Source

!2611 fix serving same port bug

Merge pull request !2611 from dinghao/master
tags/v0.6.0-beta
mindspore-ci-bot Gitee 5 years ago
parent
commit
ab3a7ceedd
2 changed files with 6 additions and 1 deletions
  1. +5
    -0
      serving/core/server.cc
  2. +1
    -1
      serving/scripts/format_source_code.sh

+ 5
- 0
serving/core/server.cc View File

@@ -273,6 +273,11 @@ Status Server::BuildAndStart() {
builder.RegisterService(&service);
// Finally assemble the server.
std::unique_ptr<grpc::Server> server(builder.BuildAndStart());
if (server == nullptr) {
MS_LOG(ERROR) << "The serving server create failed";
ClearEnv();
return FAILED;
}
auto grpc_server_run = [&server]() { server->Wait(); };
std::thread serving_thread(grpc_server_run);
MS_LOG(INFO) << "Server listening on " << server_address << std::endl;


+ 1
- 1
serving/scripts/format_source_code.sh View File

@@ -81,7 +81,7 @@ function checkopts()
checkopts "$@"

# switch to project root path, which contains clang-format config file '.clang-format'
cd "${SCRIPTS_PATH}/.." || exit 1
cd "${SCRIPTS_PATH}/../.." || exit 1

FMT_FILE_LIST='__format_files_list__'



Loading…
Cancel
Save