Merge branch 'develop' into feature/Feature-cancellaColli
Some checks failed
IntegryManagementSystem_Multi/pipeline/head There was a failure building this commit
Some checks failed
IntegryManagementSystem_Multi/pipeline/head There was a failure building this commit
This commit is contained in:
@@ -101,6 +101,7 @@ public class UserCacheService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public List<String> retrieveProfilesOfUser(String username, String password, IntegryApplicationEnum application) {
|
public List<String> retrieveProfilesOfUser(String username, String password, IntegryApplicationEnum application) {
|
||||||
|
|
||||||
ArrayList<String> profiles = new ArrayList<>();
|
ArrayList<String> profiles = new ArrayList<>();
|
||||||
|
|
||||||
for (Map.Entry<String, List<UserDTO>> users : cachedUsers.entrySet()) {
|
for (Map.Entry<String, List<UserDTO>> users : cachedUsers.entrySet()) {
|
||||||
@@ -115,6 +116,7 @@ public class UserCacheService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public @Nullable UserDTO retrieveUser(String dbName, String md5User) {
|
public @Nullable UserDTO retrieveUser(String dbName, String md5User) {
|
||||||
|
cacheLock.lock();
|
||||||
List<UserDTO> users = cachedUsers.getOrDefault(dbName, null);
|
List<UserDTO> users = cachedUsers.getOrDefault(dbName, null);
|
||||||
|
|
||||||
if (users == null || users.isEmpty())
|
if (users == null || users.isEmpty())
|
||||||
@@ -130,10 +132,12 @@ public class UserCacheService {
|
|||||||
})
|
})
|
||||||
.findFirst();
|
.findFirst();
|
||||||
|
|
||||||
|
cacheLock.unlock();
|
||||||
return foundUser.orElse(null);
|
return foundUser.orElse(null);
|
||||||
}
|
}
|
||||||
|
|
||||||
public @Nullable UserDTO retrieveUser(String dbName, String username, String password, IntegryApplicationEnum application) {
|
public @Nullable UserDTO retrieveUser(String dbName, String username, String password, IntegryApplicationEnum application) {
|
||||||
|
cacheLock.lock();
|
||||||
List<UserDTO> users = cachedUsers.getOrDefault(dbName, null);
|
List<UserDTO> users = cachedUsers.getOrDefault(dbName, null);
|
||||||
|
|
||||||
if (users == null || users.isEmpty())
|
if (users == null || users.isEmpty())
|
||||||
@@ -154,6 +158,7 @@ public class UserCacheService {
|
|||||||
(application == IntegryApplicationEnum.GESTIONALE_BASE && x.isInternal())))
|
(application == IntegryApplicationEnum.GESTIONALE_BASE && x.isInternal())))
|
||||||
.findFirst();
|
.findFirst();
|
||||||
|
|
||||||
|
cacheLock.unlock();
|
||||||
return foundUser.orElse(null);
|
return foundUser.orElse(null);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user