@@ -301,9 +301,16 @@ public abstract class FetchTask<T> extends Task<T> {
|
|||||||
concurrency = Math.max(concurrency, 1);
|
concurrency = Math.max(concurrency, 1);
|
||||||
synchronized (Schedulers.class) {
|
synchronized (Schedulers.class) {
|
||||||
downloadExecutorConcurrency = concurrency;
|
downloadExecutorConcurrency = concurrency;
|
||||||
if (DOWNLOAD_EXECUTOR != null) {
|
|
||||||
DOWNLOAD_EXECUTOR.setCorePoolSize(concurrency);
|
ThreadPoolExecutor downloadExecutor = DOWNLOAD_EXECUTOR;
|
||||||
DOWNLOAD_EXECUTOR.setMaximumPoolSize(concurrency);
|
if (downloadExecutor != null) {
|
||||||
|
if (downloadExecutor.getMaximumPoolSize() <= concurrency) {
|
||||||
|
downloadExecutor.setMaximumPoolSize(concurrency);
|
||||||
|
downloadExecutor.setCorePoolSize(concurrency);
|
||||||
|
} else {
|
||||||
|
downloadExecutor.setCorePoolSize(concurrency);
|
||||||
|
downloadExecutor.setMaximumPoolSize(concurrency);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user