File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed
marklogic-client-api/src/main/java/com/marklogic/client/datamovement/impl Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -368,9 +368,15 @@ public QueryBatcher withThreadCount(int threadCount) {
368
368
throw new IllegalArgumentException ("threadCount must be 1 or greater" );
369
369
}
370
370
if (threadPool != null ) {
371
- logger .info ("Adjusting thread pool size from {} to {}" , getThreadCount (), threadCount );
372
- threadPool .setCorePoolSize (threadCount );
373
- threadPool .setMaximumPoolSize (threadCount );
371
+ int currentThreadCount = getThreadCount ();
372
+ logger .info ("Adjusting thread pool size from {} to {}" , currentThreadCount , threadCount );
373
+ if (threadCount >= currentThreadCount ) {
374
+ threadPool .setMaximumPoolSize (threadCount );
375
+ threadPool .setCorePoolSize (threadCount );
376
+ } else {
377
+ threadPool .setCorePoolSize (threadCount );
378
+ threadPool .setMaximumPoolSize (threadCount );
379
+ }
374
380
} else {
375
381
threadCountSet = true ;
376
382
}
You can’t perform that action at this time.
0 commit comments