Skip to content

Commit

Permalink
Removed checking of values in config builder
Browse files Browse the repository at this point in the history
as builder variables now have proper default values.
  • Loading branch information
sazzad16 committed Jan 7, 2024
1 parent 0b7394d commit 1c1eba6
Showing 1 changed file with 7 additions and 23 deletions.
30 changes: 7 additions & 23 deletions src/main/java/redis/clients/jedis/MultiClusterClientConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -319,15 +319,9 @@ public MultiClusterClientConfig build() {
config.retryWaitDuration = Duration.ofMillis(this.retryWaitDuration);
config.retryWaitDurationExponentialBackoffMultiplier = this.retryWaitDurationExponentialBackoffMultiplier;

if (this.retryIncludedExceptionList != null && !retryIncludedExceptionList.isEmpty()) {
config.retryIncludedExceptionList = this.retryIncludedExceptionList;
} else {
config.retryIncludedExceptionList = RETRY_INCLUDED_EXCEPTIONS_DEFAULT;
}
config.retryIncludedExceptionList = this.retryIncludedExceptionList;

if (this.retryIgnoreExceptionList != null && !retryIgnoreExceptionList.isEmpty()) {
config.retryIgnoreExceptionList = this.retryIgnoreExceptionList;
}
config.retryIgnoreExceptionList = this.retryIgnoreExceptionList;

config.circuitBreakerFailureRateThreshold = this.circuitBreakerFailureRateThreshold;
config.circuitBreakerSlidingWindowMinCalls = this.circuitBreakerSlidingWindowMinCalls;
Expand All @@ -336,21 +330,11 @@ public MultiClusterClientConfig build() {
config.circuitBreakerSlowCallDurationThreshold = Duration.ofMillis(this.circuitBreakerSlowCallDurationThreshold);
config.circuitBreakerSlowCallRateThreshold = this.circuitBreakerSlowCallRateThreshold;

if (this.circuitBreakerIncludedExceptionList != null && !circuitBreakerIncludedExceptionList.isEmpty()) {
config.circuitBreakerIncludedExceptionList = this.circuitBreakerIncludedExceptionList;
} else {
config.circuitBreakerIncludedExceptionList = CIRCUIT_BREAKER_INCLUDED_EXCEPTIONS_DEFAULT;
}

if (this.circuitBreakerIgnoreExceptionList != null && !circuitBreakerIgnoreExceptionList.isEmpty()) {
config.circuitBreakerIgnoreExceptionList = this.circuitBreakerIgnoreExceptionList;
}

if (this.fallbackExceptionList != null && !this.fallbackExceptionList.isEmpty()) {
config.fallbackExceptionList = this.fallbackExceptionList;
} else {
config.fallbackExceptionList = FALLBACK_EXCEPTIONS_DEFAULT;
}
config.circuitBreakerIncludedExceptionList = this.circuitBreakerIncludedExceptionList;

config.circuitBreakerIgnoreExceptionList = this.circuitBreakerIgnoreExceptionList;

config.fallbackExceptionList = this.fallbackExceptionList;

return config;
}
Expand Down

0 comments on commit 1c1eba6

Please sign in to comment.