Skip to content

Commit

Permalink
fix: read in multiple realms in config store correctly (#52)
Browse files Browse the repository at this point in the history
Closes #52
  • Loading branch information
MarcScheib authored Apr 17, 2024
1 parent bfdbbe3 commit 67adfd3
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ public void create() {

final List<Path> allRealmDirectories = listDirectoriesInPath(configurationPath);
for (final Path realmConfiguration : allRealmDirectories) {
createTypeDirectoryLookup(realmConfiguration);
mapEntityTypes(createTypeDirectoryLookup(realmConfiguration));
}
}
Expand Down Expand Up @@ -101,8 +100,10 @@ private void mapEntityTypes(final Map<String, Path> typeDirectoryLookup) {
if (compareDirectoryNames(potentialEntityTypeDirectory, entityType)) {
Log.debugf("Reading files from '%s' for type '%s'.", fullEntityTypePath,
entityType);
configurationFiles.computeIfAbsent(entityType,
key -> listFilesInPath(fullEntityTypePath));
configurationFiles.compute(entityType, (key, value) -> value == null
? listFilesInPath(fullEntityTypePath)
: Stream.concat(value.stream(),
listFilesInPath(fullEntityTypePath).stream()).toList());
Log.debugf("Found %d files for type '%s'.",
configurationFiles.get(entityType).size(), entityType);
} else {
Expand Down

0 comments on commit 67adfd3

Please sign in to comment.