From 8ac8afb394cb00e79d6da2d77351bba67fc9ed81 Mon Sep 17 00:00:00 2001 From: Eduardo Pinho Date: Thu, 7 Mar 2024 12:06:31 +0000 Subject: [PATCH] [core] Dispatch batch-unindex tasks --- .../java/pt/ua/dicoogle/plugins/PluginController.java | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/dicoogle/src/main/java/pt/ua/dicoogle/plugins/PluginController.java b/dicoogle/src/main/java/pt/ua/dicoogle/plugins/PluginController.java index 3965ae941..d782760a7 100755 --- a/dicoogle/src/main/java/pt/ua/dicoogle/plugins/PluginController.java +++ b/dicoogle/src/main/java/pt/ua/dicoogle/plugins/PluginController.java @@ -787,7 +787,16 @@ public Task unindex(String indexProvider, Collection items, if (indexer == null) { indexer = this.getIndexingPlugins(true).iterator().next(); } - return indexer.unindex(items, progressCallback); + Task task = indexer.unindex(items, progressCallback); + if (task != null) { + final String taskUniqueID = UUID.randomUUID().toString(); + task.setName(String.format("[%s]unindex", indexer.getName())); + task.onCompletion(() -> { + logger.info("Unindexing task [{}] complete", taskUniqueID); + }); + taskManager.dispatch(task); + } + return task; } /** Issue an unindexing procedure to the given indexers.