mirror of https://github.com/halo-dev/halo
Fix the problem of listing users with unstable result (#3635)
#### What type of PR is this? /kind bug /area core #### What this PR does / why we need it: Use concatMap instead of flatMap to ensure stable result. Please see the differences between flatMap and concatMap from links below: - https://projectreactor.io/docs/core/release/api/reactor/core/publisher/Flux.html#flatMap-java.util.function.Function- - https://projectreactor.io/docs/core/release/api/reactor/core/publisher/Flux.html#concatMap-java.util.function.Function- #### Which issue(s) this PR fixes: Fixes https://github.com/halo-dev/halo/issues/3555 #### Special notes for your reviewer: #### Does this PR introduce a user-facing change? ```release-note 修复用户列表排序不稳定问题 ```pull/3625/head^2
parent
af2b946a56
commit
29f3c25a44
|
@ -397,7 +397,7 @@ public class UserEndpoint implements CustomEndpoint {
|
|||
|
||||
private Mono<ListResult<ListedUser>> toListedUser(ListResult<User> listResult) {
|
||||
return Flux.fromStream(listResult.get())
|
||||
.flatMap(user -> {
|
||||
.concatMap(user -> {
|
||||
Set<String> roleNames = roleNames(user);
|
||||
return roleService.list(roleNames)
|
||||
.collectList()
|
||||
|
|
Loading…
Reference in New Issue