Skip to content

Commit

Permalink
not to overwrite same config_id (#669)
Browse files Browse the repository at this point in the history
  • Loading branch information
qiwzhang authored Aug 8, 2019
1 parent bf2c6ef commit 1444daa
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/api_manager/api_manager_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,11 @@ utils::Status ApiManagerImpl::AddConfig(const std::string &service_config,

*config_id = config->service().id();

// If the config_id is already created, not to over-write, just use it.
if (service_context_map_.find(*config_id) != service_context_map_.end()) {
return utils::Status::OK;
}

auto context_service = std::make_shared<context::ServiceContext>(
global_context_, std::move(config));
if (initialize == true && context_service->service_control()) {
Expand Down

0 comments on commit 1444daa

Please sign in to comment.