fix: paginated data queries by expand (#5746)

#### What type of PR is this?
/kind bug
/area core
/milestone 2.15.x

#### What this PR does / why we need it:
修复分页遍历数据的查询参数

此问题由 #5504#5656 重构导致,如果数据超过分页限制会导致无法结束的致命问题

#### Does this PR introduce a user-facing change?
```release-note
None
```
pull/5755/head
guqing 2024-04-19 13:40:08 +08:00 committed by GitHub
parent 571df5f865
commit 36b63d6b3c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 3 additions and 3 deletions

View File

@ -152,7 +152,7 @@ public class CommentServiceImpl implements CommentService {
Sort.by("metadata.creationTimestamp", "metadata.name"));
return Flux.defer(() -> listCommentsByRef(subjectRef, pageRequest))
.expand(page -> page.hasNext()
? listCommentsByRef(subjectRef, pageRequest)
? listCommentsByRef(subjectRef, pageRequest.next())
: Mono.empty()
)
.flatMap(page -> Flux.fromIterable(page.getItems()))

View File

@ -123,7 +123,7 @@ public class ReplyServiceImpl implements ReplyService {
Sort.by("metadata.creationTimestamp", "metadata.name"));
return Flux.defer(() -> listRepliesByComment(commentName, pageRequest))
.expand(page -> page.hasNext()
? listRepliesByComment(commentName, pageRequest)
? listRepliesByComment(commentName, pageRequest.next())
: Mono.empty()
)
.flatMap(page -> Flux.fromIterable(page.getItems()))

View File

@ -98,7 +98,7 @@ public class DefaultNotificationCenter implements NotificationCenter {
Sort.by("metadata.creationTimestamp", "metadata.name"));
return Flux.defer(() -> pageSubscriptionBy(subscriber, pageRequest))
.expand(page -> page.hasNext()
? pageSubscriptionBy(subscriber, pageRequest)
? pageSubscriptionBy(subscriber, pageRequest.next())
: Mono.empty()
)
.flatMap(page -> Flux.fromIterable(page.getItems()))