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) -> {
|
||||||
|
try {
|
||||||
FileTransformerConfiguration repositoryConfigs = client.getConfiguration();
|
FileTransformerConfiguration repositoryConfigs = client.getConfiguration();
|
||||||
if (repositoryConfigs != null && !repositoryConfigs.getExportVariants().isEmpty()) {
|
if (repositoryConfigs != null && !repositoryConfigs.getExportVariants().isEmpty()) {
|
||||||
configurations.addAll(repositoryConfigs.getExportVariants());
|
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