chore: update the waiting time for publishing post (#4810)

#### 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
修改发布文章的等待时间以防止因数据库执行延迟较高导致的错误提示
```
pull/4814/head^2
guqing 2023-11-02 11:47:58 +08:00 committed by GitHub
parent 691cd38c51
commit 2d743123bf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -243,7 +243,7 @@ public class PostEndpoint implements CustomEndpoint {
}) })
.switchIfEmpty(Mono.error( .switchIfEmpty(Mono.error(
() -> new RetryException("Retry to check post publish status")))) () -> 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)); .filter(t -> t instanceof RetryException));
} }

View File

@ -170,7 +170,7 @@ class PostEndpointTest {
.is5xxServerError(); .is5xxServerError();
// Verify WebClient retry behavior // 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)); verify(client).update(any(Post.class));
} }