From 03010c9db34fa839d25f07b8bb7cdefbb1cd04f1 Mon Sep 17 00:00:00 2001 From: goulven Date: Fri, 25 Oct 2024 18:08:17 +0200 Subject: [PATCH] bug fix --- .../crawler/services/fetching/CsvIndexationWorker.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/crawler/src/main/java/org/open4goods/crawler/services/fetching/CsvIndexationWorker.java b/crawler/src/main/java/org/open4goods/crawler/services/fetching/CsvIndexationWorker.java index 9d1d5ec8f..c366ced7d 100644 --- a/crawler/src/main/java/org/open4goods/crawler/services/fetching/CsvIndexationWorker.java +++ b/crawler/src/main/java/org/open4goods/crawler/services/fetching/CsvIndexationWorker.java @@ -620,15 +620,20 @@ private void addResources(DataFragment dataFragment, Map item, D } // Adding all resources patterns + Set toRemove = new HashSet(); for (Entry attr : item.entrySet()) { if (ResourceHelper.isResource(attr.getValue())) { Resource r = new Resource(attr.getValue()); // TODO (p2, feature) : handle COVERS dataFragment.addResource(r); - removeFromSource(item, attr.getKey()); + toRemove.add( attr.getKey()); } } + toRemove.forEach(e -> { + removeFromSource(item,e); + + }); } catch (ValidationException e) { logger.warn("Problem while adding resource for {}", item);