diff --git a/ArtificialAutism/src/main/java/FunctionLayer/Datahandler.java b/ArtificialAutism/src/main/java/FunctionLayer/Datahandler.java index 199e721e..dd99bd10 100644 --- a/ArtificialAutism/src/main/java/FunctionLayer/Datahandler.java +++ b/ArtificialAutism/src/main/java/FunctionLayer/Datahandler.java @@ -27,7 +27,7 @@ import java.util.regex.Pattern; public class Datahandler { - private ExecutorService pool = Executors.newFixedThreadPool(7); + private ExecutorService pool = Executors.newFixedThreadPool(4); private CompletionService completionService = new ExecutorCompletionService(pool); private HashMap pipelineAnnotationCache; private HashMap pipelineSentimentAnnotationCache; @@ -716,10 +716,18 @@ public class Datahandler { } } catch (InterruptedException e) { //throw new RuntimeException(e); - --pending; + pending = 0; + System.out.printf(Arrays.toString(e.getStackTrace())); + pool.shutdown(); + pool = Executors.newFixedThreadPool(4); + completionService = new ExecutorCompletionService(pool); } catch (ExecutionException e) { //throw new RuntimeException(e); - --pending; + pending = 0; + System.out.printf(Arrays.toString(e.getStackTrace())); + pool.shutdown(); + pool = Executors.newFixedThreadPool(4); + completionService = new ExecutorCompletionService(pool); } }