diff --git a/include/grpc++/time.h b/include/grpc++/time.h index 1fc4ad799c6..ffcba4e35aa 100644 --- a/include/grpc++/time.h +++ b/include/grpc++/time.h @@ -40,13 +40,13 @@ namespace grpc { /* If you are trying to use CompletionQueue::AsyncNext with a time class that isn't either gpr_timespec or std::chrono::system_clock::time_point, you - will most likely be looking at that comment as your compiler will have - fired an error below. In order to fix that issue, you have two potential + will most likely be looking at this comment as your compiler will have + fired an error below. In order to fix this issue, you have two potential solutions: 1. Use gpr_timespec or std::chrono::system_clock::time_point instead 2. Specialize the TimePoint class with whichever time class that you - want to use here. See below for two examples of how to do that. + want to use here. See below for two examples of how to do this. */ template diff --git a/src/cpp/client/secure_credentials.cc b/src/cpp/client/secure_credentials.cc index 9e83ac8dcdf..48bf7430b27 100644 --- a/src/cpp/client/secure_credentials.cc +++ b/src/cpp/client/secure_credentials.cc @@ -81,27 +81,27 @@ std::unique_ptr ComputeEngineCredentials() { // Builds service account credentials. std::unique_ptr ServiceAccountCredentials( const grpc::string& json_key, const grpc::string& scope, - long token_lifetime) { - if (token_lifetime <= 0) { + long token_lifetime_seconds) { + if (token_lifetime_seconds <= 0) { gpr_log(GPR_ERROR, "Trying to create ServiceAccountCredentials " "with non-positive lifetime"); return WrapCredentials(nullptr); } - gpr_timespec lifetime = gpr_time_from_seconds(token_lifetime); + gpr_timespec lifetime = gpr_time_from_seconds(token_lifetime_seconds); return WrapCredentials(grpc_service_account_credentials_create( json_key.c_str(), scope.c_str(), lifetime)); } // Builds JWT credentials. std::unique_ptr JWTCredentials( - const grpc::string& json_key, long token_lifetime) { - if (token_lifetime <= 0) { + const grpc::string& json_key, long token_lifetime_seconds) { + if (token_lifetime_seconds <= 0) { gpr_log(GPR_ERROR, "Trying to create JWTCredentials with non-positive lifetime"); return WrapCredentials(nullptr); } - gpr_timespec lifetime = gpr_time_from_seconds(token_lifetime); + gpr_timespec lifetime = gpr_time_from_seconds(token_lifetime_seconds); return WrapCredentials( grpc_jwt_credentials_create(json_key.c_str(), lifetime)); }