Commit 473f89b2 authored by Matija Obreza's avatar Matija Obreza

Fix: Update GLIS if DOIs **are** provided

- My fault
parent 7b838e83
......@@ -68,7 +68,7 @@ public class AccessionListenersConfig {
}
return new AccessionModifiedListener() {
private final Logger LOG = LoggerFactory.getLogger(AccessionListenersConfig.class + ".glisUpdater");
private final Logger LOG = LoggerFactory.getLogger(AccessionListenersConfig.class + ".GlisUpdater");
@Override
public void onUpdate(Collection<Accession> accessions) {
......@@ -76,7 +76,7 @@ public class AccessionListenersConfig {
targets.addKwsItem(TermConstants.PASSPORT_DATA);
accessions.stream().map(a -> a.getDoi()).filter(doi -> doi != null).forEach(doi -> targets.addDoisItem(doi));
if (CollectionUtils.isEmpty(targets.getDois())) {
if (! CollectionUtils.isEmpty(targets.getDois())) {
try {
LOG.info("Updating GLIS for {} accessions with DOIs", targets.getDois().size());
List<UpdatedTarget> glisResponse = glisGenesysApi.registerGenesysAsTarget(targets);
......@@ -90,6 +90,8 @@ public class AccessionListenersConfig {
} catch (Throwable e) {
LOG.error("Error updating GLIS targets: {}", e.getMessage(), e);
}
} else {
LOG.info("Updated {} accessions do not have DOIs assigned", accessions.size());
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment