|
|
@@ -27,6 +27,7 @@ import java.util.Arrays;
|
|
|
import java.util.List;
|
|
|
import java.util.Optional;
|
|
|
import java.util.concurrent.TimeUnit;
|
|
|
+import java.util.concurrent.atomic.AtomicInteger;
|
|
|
import java.util.regex.Pattern;
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
@@ -141,11 +142,13 @@ public class IdentityAuthService {
|
|
|
public void removeDuplicated() {
|
|
|
boolean hasMore = true;
|
|
|
int pageNum = 1;
|
|
|
+ AtomicInteger count = new AtomicInteger();
|
|
|
while (hasMore) {
|
|
|
Page<Long> page = identityAuthRepo.listUserId(PageRequest.of(pageNum, 100));
|
|
|
List<Long> userIds = page.getContent();
|
|
|
userIds.parallelStream().forEach(userId -> {
|
|
|
userRepo.findById(userId).ifPresent(user -> {
|
|
|
+ log.info("removeDuplicated {}/{} ", count.incrementAndGet(), page.getTotalElements());
|
|
|
List<IdentityAuth> list = identityAuthRepo.findByUserId(userId);
|
|
|
if (list.size() > 1) {
|
|
|
IdentityAuth auth = list.stream()
|