mirror of
https://github.com/Sheldan/abstracto.git
synced 2026-04-16 04:21:49 +00:00
[AB-25] artificial delay
This commit is contained in:
@@ -188,9 +188,14 @@ public class AUserExperienceServiceBean implements AUserExperienceService {
|
|||||||
|
|
||||||
List<List<Long>> partitionedUserIds = ListUtils.partition(userIds, 100);
|
List<List<Long>> partitionedUserIds = ListUtils.partition(userIds, 100);
|
||||||
List<CompletableFuture<List<Member>>> memberLoadingFutures = new ArrayList<>();
|
List<CompletableFuture<List<Member>>> memberLoadingFutures = new ArrayList<>();
|
||||||
partitionedUserIds.forEach(userIdsPart -> {
|
for (List<Long> userIdsPart : partitionedUserIds) {
|
||||||
memberLoadingFutures.add(memberService.getMembersInServerAsync(server.getId(), userIdsPart));
|
memberLoadingFutures.add(memberService.getMembersInServerAsync(server.getId(), userIdsPart));
|
||||||
});
|
try {
|
||||||
|
Thread.sleep(500L);
|
||||||
|
} catch (InterruptedException e) {
|
||||||
|
log.error("Failed to sleep.", e);
|
||||||
|
}
|
||||||
|
}
|
||||||
CompletableFutureList<List<Member>> listCompletableFutureList = new CompletableFutureList<>(memberLoadingFutures);
|
CompletableFutureList<List<Member>> listCompletableFutureList = new CompletableFutureList<>(memberLoadingFutures);
|
||||||
listCompletableFutureList.getMainFuture().whenComplete((result, throwable) -> {
|
listCompletableFutureList.getMainFuture().whenComplete((result, throwable) -> {
|
||||||
List<Member> members = new ArrayList<>();
|
List<Member> members = new ArrayList<>();
|
||||||
|
|||||||
Reference in New Issue
Block a user