New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor: snapshot attributes and post publish #2709
refactor: snapshot attributes and post publish #2709
Conversation
/kind api-change |
…ttribute # Conflicts: # src/main/resources/extensions/role-template-post.yaml
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
@guqing 需要处理一下冲突。 |
实际测试时,可能会发生如下错误: 2022-11-18T16:29:12.193+08:00 ERROR 4940 --- [ parallel-7] a.w.r.e.AbstractErrorWebExceptionHandler : [87be3966-69] 500 Server Error for HTTP PUT "/apis/api.console.halo.run/v1alpha1/posts/0386ce9c-56fd-4cbb-9020-889010c51866/publish"
reactor.core.Exceptions$RetryExhaustedException: Retries exhausted: 10/10
at reactor.core.Exceptions.retryExhausted(Exceptions.java:306) ~[reactor-core-3.5.0.jar:3.5.0]
Suppressed: reactor.core.publisher.FluxOnAssembly$OnAssemblyException:
Assembly trace from producer [reactor.core.publisher.FluxConcatMapNoPrefetch] :
reactor.core.publisher.Flux.concatMap(Flux.java:3877)
reactor.util.retry.RetryBackoffSpec.lambda$generateCompanion$6(RetryBackoffSpec.java:545)
Error has been observed at the following site(s):
*__________Flux.concatMap ⇢ at reactor.util.retry.RetryBackoffSpec.lambda$generateCompanion$6(RetryBackoffSpec.java:545)
|_ Flux.contextWrite ⇢ at reactor.util.retry.RetryBackoffSpec.lambda$generateCompanion$6(RetryBackoffSpec.java:609)
*____Flux.deferContextual ⇢ at reactor.util.retry.RetryBackoffSpec.generateCompanion(RetryBackoffSpec.java:543)
*__________Mono.retryWhen ⇢ at run.halo.app.core.extension.endpoint.PostEndpoint.lambda$publishPost$16(PostEndpoint.java:200)
*____________Mono.flatMap ⇢ at run.halo.app.core.extension.endpoint.PostEndpoint.publishPost(PostEndpoint.java:189)
|_ Mono.flatMap ⇢ at run.halo.app.core.extension.endpoint.PostEndpoint.publishPost(PostEndpoint.java:203)
|_ Mono.map ⇢ at org.springframework.web.reactive.function.server.support.HandlerFunctionAdapter.handle(HandlerFunctionAdapter.java:62)
|_ Mono.flatMap ⇢ at org.springframework.web.reactive.DispatcherHandler.handleRequestWith(DispatcherHandler.java:184)
*____________Mono.flatMap ⇢ at org.springframework.web.reactive.DispatcherHandler.handle(DispatcherHandler.java:154)
*______________Mono.defer ⇢ at org.springframework.web.server.handler.DefaultWebFilterChain.filter(DefaultWebFilterChain.java:106)
|_ Mono.doOnEach ⇢ at org.springframework.web.filter.reactive.ServerHttpObservationFilter.filter(ServerHttpObservationFilter.java:108)
|_ Mono.doOnCancel ⇢ at org.springframework.web.filter.reactive.ServerHttpObservationFilter.filter(ServerHttpObservationFilter.java:118)
|_ Mono.contextWrite ⇢ at org.springframework.web.filter.reactive.ServerHttpObservationFilter.filter(ServerHttpObservationFilter.java:122)
*__Mono.transformDeferred ⇢ at org.springframework.web.filter.reactive.ServerHttpObservationFilter.filter(ServerHttpObservationFilter.java:101)
|_ checkpoint ⇢ org.springframework.web.filter.reactive.ServerHttpObservationFilter [DefaultWebFilterChain]
*______________Mono.defer ⇢ at org.springframework.web.server.handler.DefaultWebFilterChain.filter(DefaultWebFilterChain.java:106) 2022-11-18T16:34:26.993+08:00 ERROR 4940 --- [ task-2] reactor.core.publisher.Operators : Operator called default onErrorDropped
reactor.core.Exceptions$ErrorCallbackNotImplemented: java.lang.IllegalArgumentException: value must not be null
Caused by: java.lang.IllegalArgumentException: value must not be null
at org.apache.lucene.document.Field.<init>(Field.java:235) ~[lucene-core-9.4.1.jar:9.4.1 810817993e0956e63e29906e78a245949501b77d - ivera - 2022-10-20 15:29:24]
Suppressed: reactor.core.publisher.FluxOnAssembly$OnAssemblyException:
Assembly trace from producer [reactor.core.publisher.MonoPeekFuseable] :
reactor.core.publisher.Mono.doOnNext(Mono.java:2643)
run.halo.app.search.post.PostEventListener.lambda$handlePostPublished$1(PostEventListener.java:36)
Error has been observed at the following site(s):
*___Mono.doOnNext ⇢ at run.halo.app.search.post.PostEventListener.lambda$handlePostPublished$1(PostEventListener.java:36)
*____Mono.flatMap ⇢ at run.halo.app.search.post.PostEventListener.handlePostPublished(PostEventListener.java:35)
|_ Mono.doFinally ⇢ at run.halo.app.search.post.PostEventListener.handlePostPublished(PostEventListener.java:44)
Original Stack Trace:
at org.apache.lucene.document.Field.<init>(Field.java:235) ~[lucene-core-9.4.1.jar:9.4.1 810817993e0956e63e29906e78a245949501b77d - ivera - 2022-10-20 15:29:24]
at org.apache.lucene.document.StoredField.<init>(StoredField.java:116) ~[lucene-core-9.4.1.jar:9.4.1 810817993e0956e63e29906e78a245949501b77d - ivera - 2022-10-20 15:29:24]
at run.halo.app.search.post.LucenePostSearchService.convert(LucenePostSearchService.java:157) ~[classes/:na]
at run.halo.app.search.post.LucenePostSearchService.lambda$addDocuments$0(LucenePostSearchService.java:100) ~[classes/:na]
at java.base/java.lang.Iterable.forEach(Iterable.java:75) ~[na:na]
at run.halo.app.search.post.LucenePostSearchService.addDocuments(LucenePostSearchService.java:99) ~[classes/:na]
at run.halo.app.search.post.PostEventListener.lambda$handlePostPublished$0(PostEventListener.java:38) ~[classes/:na] 测试步骤:
|
…ttribute # Conflicts: # src/main/java/run/halo/app/config/ExtensionConfiguration.java
20a244e
to
8eac9e6
Compare
|
以上问题建议在下一个 PR 优化。 /approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: JohnNiang The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
#### What type of PR is this? /kind improvement /milestone 2.0 #### What this PR does / why we need it: 优化文章和自定义页面的保存内容和发布逻辑。详情可查阅:halo-dev/halo#2709 #### Special notes for your reviewer: /cc @halo-dev/sig-halo-console 测试流程: 1. Halo 需要切换到 halo-dev/halo#2709 分支。 2. 测试文章和自定义页面的新建、更新内容,以及发布。 #### Does this PR introduce a user-facing change? ```release-note 优化文章和自定义页面的保存内容和发布逻辑。 ```
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
…v/console#696) #### What type of PR is this? /kind improvement /milestone 2.0 #### What this PR does / why we need it: 优化文章和自定义页面的保存内容和发布逻辑。详情可查阅:halo-dev#2709 #### Special notes for your reviewer: /cc @halo-dev/sig-halo-console 测试流程: 1. Halo 需要切换到 halo-dev#2709 分支。 2. 测试文章和自定义页面的新建、更新内容,以及发布。 #### Does this PR introduce a user-facing change? ```release-note 优化文章和自定义页面的保存内容和发布逻辑。 ```
What type of PR is this?
/kind improvement
/area core
/milestone 2.0
What this PR does / why we need it:
Console 端需要做出一些修改:
/posts/{name}/content
/singlepages/{name}/content
发布接口提供了一个
async
参数,默认值为false
此时发布API需要等待发布成功后才返回结果,如果等待超时则提示Publishing wait timeout.
, 如果传递async=true
表示异步发布,更新完数据就成功,reconciler 在后台慢慢执行。Special notes for your reviewer:
how to test it?
/cc @halo-dev/sig-halo
Does this PR introduce a user-facing change?