just badly recreating threadpool in case thread is stuck
This commit is contained in:
parent
845c6dd0c0
commit
4c098cd683
@ -27,7 +27,7 @@ import java.util.regex.Pattern;
|
|||||||
|
|
||||||
public class Datahandler {
|
public class Datahandler {
|
||||||
|
|
||||||
private ExecutorService pool = Executors.newFixedThreadPool(7);
|
private ExecutorService pool = Executors.newFixedThreadPool(4);
|
||||||
private CompletionService completionService = new ExecutorCompletionService(pool);
|
private CompletionService completionService = new ExecutorCompletionService(pool);
|
||||||
private HashMap<String, Annotation> pipelineAnnotationCache;
|
private HashMap<String, Annotation> pipelineAnnotationCache;
|
||||||
private HashMap<String, Annotation> pipelineSentimentAnnotationCache;
|
private HashMap<String, Annotation> pipelineSentimentAnnotationCache;
|
||||||
@ -716,10 +716,18 @@ public class Datahandler {
|
|||||||
}
|
}
|
||||||
} catch (InterruptedException e) {
|
} catch (InterruptedException e) {
|
||||||
//throw new RuntimeException(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) {
|
} catch (ExecutionException e) {
|
||||||
//throw new RuntimeException(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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user