diff --git a/HDX-System/src/main/java/org/ocha/hdx/jobs/MetadataUpdater.java b/HDX-System/src/main/java/org/ocha/hdx/jobs/MetadataUpdater.java index b522760d..f067416a 100644 --- a/HDX-System/src/main/java/org/ocha/hdx/jobs/MetadataUpdater.java +++ b/HDX-System/src/main/java/org/ocha/hdx/jobs/MetadataUpdater.java @@ -14,7 +14,7 @@ public class MetadataUpdater implements Runnable { private CkanSynchronizerService ckanSynchronizerServiceImpl; @Override - @Scheduled(fixedDelay = 100000, initialDelay = 1000) + @Scheduled(fixedDelay = 10000, initialDelay = 1000) public void run() { try { log.debug("Starting MetadataUpdater.run"); diff --git a/HDX-System/src/main/java/org/ocha/hdx/service/CkanSynchronizerServiceImpl.java b/HDX-System/src/main/java/org/ocha/hdx/service/CkanSynchronizerServiceImpl.java index 6734b759..7a8119a7 100644 --- a/HDX-System/src/main/java/org/ocha/hdx/service/CkanSynchronizerServiceImpl.java +++ b/HDX-System/src/main/java/org/ocha/hdx/service/CkanSynchronizerServiceImpl.java @@ -75,8 +75,14 @@ private HdxPackageUpdateMetadataDTO convertDataSerieToCuratedDataset(final DataS final Source source = dataSerieToCuratedDataset.getSource(); final HdxPackageUpdateMetadataDTO dto = new HdxPackageUpdateMetadataDTO(); - dto.setId(dataSerieToCuratedDataset.getCkanDatasetId()); - dto.setId(dataSerieToCuratedDataset.getCkanDatasetName()); + + if (dataSerieToCuratedDataset.getCkanDatasetId() != null && !dataSerieToCuratedDataset.getCkanDatasetId().isEmpty()) { + dto.setId(dataSerieToCuratedDataset.getCkanDatasetId()); + } + + if (dataSerieToCuratedDataset.getCkanDatasetName() != null && !dataSerieToCuratedDataset.getCkanDatasetName().isEmpty()) { + dto.setName(dataSerieToCuratedDataset.getCkanDatasetName()); + } final Map minMaxDatesForDataSeries = curatedDataService.getMinMaxDatesForDataSeries(new DataSerie(indType.getCode(), source.getCode())); final DateTimeFormatter customFormatter = DateTimeFormat.forPattern("MM/dd/YYYY");