From 458b12fb2fa49c889dd55affaadc9858f6802401 Mon Sep 17 00:00:00 2001 From: goulven Date: Sun, 6 Oct 2024 20:40:39 +0200 Subject: [PATCH] Removing possible stop condition --- .../api/config/yml/ApiProperties.java | 19 ------------------- .../CsvDatasourceFetchingService.java | 1 - .../fetching/CsvIndexationWorker.java | 11 ++--------- 3 files changed, 2 insertions(+), 29 deletions(-) diff --git a/api/src/main/java/org/open4goods/api/config/yml/ApiProperties.java b/api/src/main/java/org/open4goods/api/config/yml/ApiProperties.java index e2c3545da..b751c25ed 100644 --- a/api/src/main/java/org/open4goods/api/config/yml/ApiProperties.java +++ b/api/src/main/java/org/open4goods/api/config/yml/ApiProperties.java @@ -114,11 +114,6 @@ public class ApiProperties { */ private Integer dataFragmentsDequeueSize = 200; - /** - * The datafragments dequeue worker size - */ - private Integer dataFragmentsDequeueWorkers = 4; - /** * The datafragments worker dequeue poll period, in ms */ @@ -403,20 +398,6 @@ public void setRootFolder(final String rootFolder) { - - - public Integer getDataFragmentsDequeueWorkers() { - return dataFragmentsDequeueWorkers; - } - - - - public void setDataFragmentsDequeueWorkers(Integer dataFragmentsDequeueWorker) { - dataFragmentsDequeueWorkers = dataFragmentsDequeueWorker; - } - - - public boolean isOperatesNlpProcessing() { return operatesNlpProcessing; } diff --git a/crawler/src/main/java/org/open4goods/crawler/services/fetching/CsvDatasourceFetchingService.java b/crawler/src/main/java/org/open4goods/crawler/services/fetching/CsvDatasourceFetchingService.java index 92e78d9c9..350248078 100644 --- a/crawler/src/main/java/org/open4goods/crawler/services/fetching/CsvDatasourceFetchingService.java +++ b/crawler/src/main/java/org/open4goods/crawler/services/fetching/CsvDatasourceFetchingService.java @@ -101,7 +101,6 @@ public void start(final DataSourceProperties pConfig, final String datasourceCon @Override public void stop(final String providerName) { indexationService.clearIndexedCounter(providerName); - runningJobs.get(providerName).stop(); } @Override 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 673af6737..fddd3e1d6 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 @@ -89,7 +89,7 @@ public class CsvIndexationWorker implements Runnable { /** * State flag */ - private volatile boolean stop; +// private volatile boolean stop; /** * The externaly maintained stats @@ -117,7 +117,7 @@ public CsvIndexationWorker(final CsvDatasourceFetchingService csvService, DataFr @Override public void run() { - while (!stop) { + while (true) { try { if (!csvService.getQueue().isEmpty()) { // There is data to consume and queue consummation is enabled @@ -696,13 +696,6 @@ private List getCategoryFromCsvRows(Map item) { return ret; } - /** - * Say this thread to stop - */ - public void stop() { - this.stop = true; - } - public synchronized IndexationJobStat stats() { return stats; }