Skip to content

Commit

Permalink
Modify the field name of the retry policy
Browse files Browse the repository at this point in the history
  • Loading branch information
chenzhiguo committed May 7, 2024
1 parent 15019e3 commit c60ed11
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 16 deletions.
9 changes: 2 additions & 7 deletions joylive-bom/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -348,11 +348,6 @@
</goals>
</execution>
</executions>
<configuration>
<excludes>
<exclude>com/jdcloud/**</exclude>
</excludes>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
Expand Down Expand Up @@ -423,12 +418,12 @@
</build>
<distributionManagement>
<snapshotRepository>
<id>jdcloud</id>
<id>jd</id>
<name>OSS Snapshots Repository</name>
<url>https://oss.sonatype.org/content/repositories/snapshots/</url>
</snapshotRepository>
<repository>
<id>jdcloud</id>
<id>jd</id>
<name>OSS Staging Repository</name>
<url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
</repository>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,9 @@ public class RetryPolicy extends PolicyId implements PolicyInheritWithId<RetryPo
private Integer retry;

/**
* The timeout in milliseconds for each retry attempt. This parameter specifies how long the system should
* wait for an operation to complete before timing out and potentially retrying the operation, according
* to the retry policy.
* Retry waiting interval, in milliseconds.
*/
private Integer timeoutInMilliseconds;
private Integer waitTimeInMilliseconds;

/**
* Collection of retry status codes. This parameter specifies which status codes should be considered retryable.
Expand Down Expand Up @@ -93,8 +91,8 @@ public void supplement(RetryPolicy source) {
if (retry == null) {
retry = source.retry;
}
if (timeoutInMilliseconds == null) {
timeoutInMilliseconds = source.timeoutInMilliseconds;
if (waitTimeInMilliseconds == null) {
waitTimeInMilliseconds = source.waitTimeInMilliseconds;
}
if ((retryableStatusCodes == null || retryableStatusCodes.isEmpty()) && source.retryableStatusCodes != null) {
retryableStatusCodes = source.retryableStatusCodes;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public Resilience4jRetrier(RetryPolicy policy) {
this.policy = policy;
RetryConfig config = RetryConfig.custom()
.maxAttempts(policy.getRetry())
.waitDuration(Duration.ofMillis(policy.getTimeoutInMilliseconds()))
.waitDuration(Duration.ofMillis(policy.getWaitTimeInMilliseconds()))
.retryOnResult(response -> {
if (policy.getRetryableStatusCodes() != null) {
return policy.getRetryableStatusCodes().contains(((Response) response).getCode());
Expand Down
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -277,12 +277,12 @@
</build>
<distributionManagement>
<snapshotRepository>
<id>jdcloud</id>
<id>jd</id>
<name>OSS Snapshots Repository</name>
<url>https://oss.sonatype.org/content/repositories/snapshots/</url>
</snapshotRepository>
<repository>
<id>jdcloud</id>
<id>jd</id>
<name>OSS Staging Repository</name>
<url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
</repository>
Expand Down

0 comments on commit c60ed11

Please sign in to comment.