From 890cd97c60013fa093dc3114882131628a2c381b Mon Sep 17 00:00:00 2001 From: Bart Maertens Date: Sat, 18 Nov 2023 05:37:48 +0100 Subject: [PATCH] only scan subfolders instead of all files to drastically reduce execution information perspective loading time. #2845 --- .../hop/execution/local/FileExecutionInfoLocation.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/engine/src/main/java/org/apache/hop/execution/local/FileExecutionInfoLocation.java b/engine/src/main/java/org/apache/hop/execution/local/FileExecutionInfoLocation.java index 479c44702a7..15c7d6b2447 100644 --- a/engine/src/main/java/org/apache/hop/execution/local/FileExecutionInfoLocation.java +++ b/engine/src/main/java/org/apache/hop/execution/local/FileExecutionInfoLocation.java @@ -31,6 +31,9 @@ import java.util.List; import org.apache.commons.lang.StringUtils; import org.apache.commons.vfs2.FileObject; +import org.apache.commons.vfs2.FileSelector; +import org.apache.commons.vfs2.FileType; +import org.apache.commons.vfs2.FileTypeSelector; import org.apache.hop.core.exception.HopException; import org.apache.hop.core.gui.plugin.GuiElementType; import org.apache.hop.core.gui.plugin.GuiPlugin; @@ -354,7 +357,8 @@ public synchronized List getExecutionIds(boolean includeChildren, int li if (!folder.exists()) { return Collections.emptyList(); } - for (FileObject child : folder.getChildren()) { + FileObject[] childFolders = folder.findFiles(new FileTypeSelector(FileType.FOLDER)); + for (FileObject child : childFolders) { if (child.isFolder()) { subFolders.add(child); }