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 { ...@@ -68,7 +68,7 @@ public class AccessionListenersConfig {
} }
return new AccessionModifiedListener() { return new AccessionModifiedListener() {
private final Logger LOG = LoggerFactory.getLogger(AccessionListenersConfig.class + ".glisUpdater"); private final Logger LOG = LoggerFactory.getLogger(AccessionListenersConfig.class + ".GlisUpdater");
@Override @Override
public void onUpdate(Collection<Accession> accessions) { public void onUpdate(Collection<Accession> accessions) {
...@@ -76,7 +76,7 @@ public class AccessionListenersConfig { ...@@ -76,7 +76,7 @@ public class AccessionListenersConfig {
targets.addKwsItem(TermConstants.PASSPORT_DATA); targets.addKwsItem(TermConstants.PASSPORT_DATA);
accessions.stream().map(a -> a.getDoi()).filter(doi -> doi != null).forEach(doi -> targets.addDoisItem(doi)); 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 { try {
LOG.info("Updating GLIS for {} accessions with DOIs", targets.getDois().size()); LOG.info("Updating GLIS for {} accessions with DOIs", targets.getDois().size());
List<UpdatedTarget> glisResponse = glisGenesysApi.registerGenesysAsTarget(targets); List<UpdatedTarget> glisResponse = glisGenesysApi.registerGenesysAsTarget(targets);
...@@ -90,6 +90,8 @@ public class AccessionListenersConfig { ...@@ -90,6 +90,8 @@ public class AccessionListenersConfig {
} catch (Throwable e) { } catch (Throwable e) {
LOG.error("Error updating GLIS targets: {}", e.getMessage(), 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