Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -193,10 +193,10 @@ Status Aggregated::Init() {
options.periodic_timer = [this](int interval_ms,
std::function<void()> callback)
-> std::unique_ptr<::google::service_control_client::PeriodicTimer> {
return std::unique_ptr<::google::service_control_client::PeriodicTimer>(
new ApiManagerPeriodicTimer(env_->StartPeriodicTimer(
std::chrono::milliseconds(interval_ms), callback)));
};
return std::unique_ptr<::google::service_control_client::PeriodicTimer>(
new ApiManagerPeriodicTimer(env_->StartPeriodicTimer(
std::chrono::milliseconds(interval_ms), callback)));
};
client_ = ::google::service_control_client::CreateServiceControlClient(
service_->name(), service_->id(), options);
return Status::OK;
Expand Down Expand Up @@ -289,7 +289,10 @@ void Aggregated::Check(
*response, service_control_proto_.service_name(), &response_info);
// If allow_unregistered_calls is true, it is always OK to proceed.
if (allow_unregistered_calls) {
on_done(Status::OK, response_info);
if (response_info.is_api_key_valid &&
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please combine two "if" into one

response_info.service_is_activated) {
on_done(Status::OK, response_info);
}
} else {
on_done(status, response_info);
}
Expand Down