Skip to content

Commit

Permalink
chore: update the waiting time for publishing post (#4810)
Browse files Browse the repository at this point in the history
#### What type of PR is this?
/kind improvement
/area core
/milestone 2.11.x

#### What this PR does / why we need it:
修改发布文章的等待时间以防止因数据库执行延迟较高导致的错误提示

最大等待时间为:`100ms * 2 ^ (retryNum - 1)` = `1600ms`
总共需等待时间为:`100ms * (2 ^ retryNum - 1)` = `3100ms`

#### Does this PR introduce a user-facing change?
```release-note
修改发布文章的等待时间以防止因数据库执行延迟较高导致的错误提示
```
  • Loading branch information
guqing authored Nov 2, 2023
1 parent 691cd38 commit 2d74312
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ private Mono<Post> awaitPostPublished(String postName) {
})
.switchIfEmpty(Mono.error(
() -> new RetryException("Retry to check post publish status"))))
.retryWhen(Retry.fixedDelay(10, Duration.ofMillis(200))
.retryWhen(Retry.backoff(5, Duration.ofMillis(100))
.filter(t -> t instanceof RetryException));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ void shouldFailIfWaitTimeoutForPublishedStatus() {
.is5xxServerError();

// Verify WebClient retry behavior
verify(client, times(12)).get(eq(Post.class), eq("post-1"));
verify(client, times(7)).get(eq(Post.class), eq("post-1"));
verify(client).update(any(Post.class));
}

Expand Down

0 comments on commit 2d74312

Please sign in to comment.