mirror of https://github.com/halo-dev/halo
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
parent
691cd38c51
commit
2d743123bf
|
@ -243,7 +243,7 @@ public class PostEndpoint implements CustomEndpoint {
|
|||
})
|
||||
.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));
|
||||
}
|
||||
|
||||
|
|
|
@ -170,7 +170,7 @@ class PostEndpointTest {
|
|||
.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));
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue