Skip to content

Commit

Permalink
feat(core): sort users by IDs when synchronizing LDAP
Browse files Browse the repository at this point in the history
- When synchronizing whole LDAP sort processed users
  by their IDs to get more consistent log output.
  • Loading branch information
zlamalp committed Sep 13, 2023
1 parent 19fef38 commit cf542ed
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@
import cz.metacentrum.perun.ldapc.model.PerunUser;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.BeansException;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
import org.springframework.stereotype.Component;

import javax.naming.Name;
import java.util.ArrayList;
import java.util.Comparator;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
Expand Down Expand Up @@ -115,6 +115,7 @@ public void synchronizeUsers() {

log.debug("Getting list of users");
List<User> users = perun.getUsersManagerBl().getUsers(ldapcManager.getPerunSession());
users.sort(Comparator.comparingInt(User::getId));
Set<Name> presentUsers = new HashSet<Name>(users.size());

syncExecutor.setCorePoolSize(5);
Expand Down

0 comments on commit cf542ed

Please sign in to comment.