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
|
//GK: So much for lazy loading
|
||||||
List<TransformerRepository> repositories = transformerProperties.getSources().stream().map(depositSource -> getRepository(depositSource.getCodes().get(0))).toList();
|
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) -> {
|
repositories.forEach((client) -> {
|
||||||
FileTransformerConfiguration repositoryConfigs = client.getConfiguration();
|
try {
|
||||||
if (repositoryConfigs != null && !repositoryConfigs.getExportVariants().isEmpty()) {
|
FileTransformerConfiguration repositoryConfigs = client.getConfiguration();
|
||||||
configurations.addAll(repositoryConfigs.getExportVariants());
|
if (repositoryConfigs != null && !repositoryConfigs.getExportVariants().isEmpty()) {
|
||||||
|
configurations.addAll(repositoryConfigs.getExportVariants());
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
toDelete.add(client);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
repositories.removeAll(toDelete);
|
||||||
|
|
||||||
configs = new TransformerCacheModel(configurations);
|
configs = new TransformerCacheModel(configurations);
|
||||||
this.fileTransformerConfigurationCache.put("base", configs);
|
this.fileTransformerConfigurationCache.put("base", configs);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue