File tree Expand file tree Collapse file tree 1 file changed +8
-4
lines changed
plugin/src/main/java/org/opensearch/ml/task Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change 55
66package org .opensearch .ml .task ;
77
8+ import static org .opensearch .ml .plugin .MachineLearningPlugin .TASK_THREAD_POOL ;
9+
810import lombok .extern .log4j .Log4j2 ;
911
1012import org .opensearch .action .ActionListener ;
@@ -61,10 +63,12 @@ public void executeTask(
6163 TransportService transportService ,
6264 ActionListener <MLExecuteTaskResponse > listener
6365 ) {
64- Input input = request .getInput ();
65- Output output = MLEngine .execute (input );
66- MLExecuteTaskResponse response = MLExecuteTaskResponse .builder ().output (output ).build ();
67- listener .onResponse (response );
66+ threadPool .executor (TASK_THREAD_POOL ).execute (() -> {
67+ Input input = request .getInput ();
68+ Output output = MLEngine .execute (input );
69+ MLExecuteTaskResponse response = MLExecuteTaskResponse .builder ().output (output ).build ();
70+ listener .onResponse (response );
71+ });
6872 }
6973
7074}
You can’t perform that action at this time.
0 commit comments