Skip to content

Commit

Permalink
temp: mock generate code changes from additional method-level retry
Browse files Browse the repository at this point in the history
  • Loading branch information
emmileaf committed May 8, 2023
1 parent a683a99 commit 44bab39
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,20 @@ public LanguageServiceSettings languageServiceSettings(
"Configured method-level retry settings for analyzeSentiment from properties.");
}
}
Retry analyzeSentimentRetryCopy = clientProperties.getAnalyzeSentimentRetryCopy();
if (analyzeSentimentRetryCopy != null) {
RetrySettings analyzeSentimentRetrySettings =
RetryUtil.updateRetrySettings(
clientSettingsBuilder.analyzeSentimentSettings().getRetrySettings(),
analyzeSentimentRetryCopy);
clientSettingsBuilder
.analyzeSentimentSettings()
.setRetrySettings(analyzeSentimentRetrySettings);
if (LOGGER.isTraceEnabled()) {
LOGGER.trace(
"Configured method-level retry settings for analyzeSentiment from properties (copy).");
}
}
Retry analyzeEntitiesRetry = clientProperties.getAnalyzeEntitiesRetry();
if (analyzeEntitiesRetry != null) {
RetrySettings analyzeEntitiesRetrySettings =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,11 @@ public class LanguageServiceSpringProperties implements CredentialsSupplier {
* precedence over service-level retry configurations for that RPC method.
*/
@NestedConfigurationProperty private Retry analyzeSentimentRetry;
/**
* Allow override of retry settings at method-level for analyzeSentiment. If defined, this takes
* precedence over service-level retry configurations for that RPC method.
*/
@NestedConfigurationProperty private Retry analyzeSentimentRetryCopy;
/**
* Allow override of retry settings at method-level for analyzeEntities. If defined, this takes
* precedence over service-level retry configurations for that RPC method.
Expand Down Expand Up @@ -120,6 +125,14 @@ public void setAnalyzeSentimentRetry(Retry analyzeSentimentRetry) {
this.analyzeSentimentRetry = analyzeSentimentRetry;
}

public Retry getAnalyzeSentimentRetryCopy() {
return this.analyzeSentimentRetryCopy;
}

public void setAnalyzeSentimentRetryCopy(Retry analyzeSentimentRetryCopy) {
this.analyzeSentimentRetryCopy = analyzeSentimentRetryCopy;
}

public Retry getAnalyzeEntitiesRetry() {
return this.analyzeEntitiesRetry;
}
Expand Down

0 comments on commit 44bab39

Please sign in to comment.