[AB-25] artificial delay

This commit is contained in:
Sheldan
2022-11-20 23:20:07 +01:00
parent 2db36ef96b
commit a0b2fc9c31

View File

@@ -188,9 +188,14 @@ public class AUserExperienceServiceBean implements AUserExperienceService {
List<List<Long>> partitionedUserIds = ListUtils.partition(userIds, 100);
List<CompletableFuture<List<Member>>> memberLoadingFutures = new ArrayList<>();
partitionedUserIds.forEach(userIdsPart -> {
for (List<Long> userIdsPart : partitionedUserIds) {
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);
listCompletableFutureList.getMainFuture().whenComplete((result, throwable) -> {
List<Member> members = new ArrayList<>();