Fix error if one of the file transformer clients doesn't respond
This commit is contained in:
parent
447059530d
commit
c9121ebb1a
|
@ -110,13 +110,21 @@ public class FileTransformerService {
|
|||
//GK: So much for lazy loading
|
||||
List<TransformerRepository> repositories = transformerProperties.getSources().stream().map(depositSource -> getRepository(depositSource.getCodes().get(0))).toList();
|
||||
|
||||
repositories = new ArrayList<>(repositories);
|
||||
List<TransformerRepository> toDelete = new ArrayList<>();
|
||||
repositories.forEach((client) -> {
|
||||
FileTransformerConfiguration repositoryConfigs = client.getConfiguration();
|
||||
if (repositoryConfigs != null && !repositoryConfigs.getExportVariants().isEmpty()) {
|
||||
configurations.addAll(repositoryConfigs.getExportVariants());
|
||||
try {
|
||||
FileTransformerConfiguration repositoryConfigs = client.getConfiguration();
|
||||
if (repositoryConfigs != null && !repositoryConfigs.getExportVariants().isEmpty()) {
|
||||
configurations.addAll(repositoryConfigs.getExportVariants());
|
||||
}
|
||||
} catch (Exception e) {
|
||||
toDelete.add(client);
|
||||
}
|
||||
});
|
||||
|
||||
repositories.removeAll(toDelete);
|
||||
|
||||
configs = new TransformerCacheModel(configurations);
|
||||
this.fileTransformerConfigurationCache.put("base", configs);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue