Skip to content

Commit

Permalink
fix: 修复forUpdate无效问题
Browse files Browse the repository at this point in the history
  • Loading branch information
zhou-hao committed Aug 11, 2023
1 parent cd92582 commit 5c33e3e
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ public Flux<T> fetch() {
.where(param.getTerms())
.orderBy(getSortOrder())
.when(param.isPaging(), query -> query.paging(param.getPageIndex(), param.getPageSize()))
.when(param.isForUpdate(), QueryOperator::forUpdate)
.fetch(eventWrapper(tableMetadata, wrapper, executorType("reactive"), type("fetch")))
.reactive())
.contextWrite(ctx->ctx.put(Logger.class,logger));
Expand All @@ -67,9 +68,11 @@ public Mono<T> fetchOne() {
.select(getSelectColumn())
.where(param.getTerms())
.orderBy(getSortOrder())
.paging(0, 1)
//.paging(0, 1)
.when(param.isForUpdate(), QueryOperator::forUpdate)
.fetch(eventWrapper(tableMetadata, wrapper, executorType("reactive"), type("fetchOne")))
.reactive())
.reactive()
.take(1))
.contextWrite(ctx-> ctx.put(Logger.class,logger))
.singleOrEmpty();
}
Expand Down

0 comments on commit 5c33e3e

Please sign in to comment.