From 8d8324587507e2e7b17b2f75857f1073c3fd5f73 Mon Sep 17 00:00:00 2001 From: Administrator Date: Wed, 31 Dec 2014 17:42:18 +0100 Subject: [PATCH] #298 --- .../main/java/org/ocha/hdx/jobs/MetadataUpdater.java | 2 +- .../ocha/hdx/service/CkanSynchronizerServiceImpl.java | 10 ++++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) 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");