mirror of
https://github.com/ysoftdevs/DependencyCheck.git
synced 2026-01-14 15:53:36 +01:00
updated threadpool size
This commit is contained in:
@@ -613,9 +613,7 @@ public class Engine implements FileFilter {
|
||||
*/
|
||||
protected ExecutorService getExecutorService(Analyzer analyzer) {
|
||||
if (analyzer.supportsParallelProcessing()) {
|
||||
// just a fair trade-off that should be reasonable for all analyzer types
|
||||
final int maximumNumberOfThreads = 4 * Runtime.getRuntime().availableProcessors();
|
||||
|
||||
final int maximumNumberOfThreads = Runtime.getRuntime().availableProcessors();
|
||||
LOGGER.debug("Parallel processing with up to {} threads: {}.", maximumNumberOfThreads, analyzer.getName());
|
||||
return Executors.newFixedThreadPool(maximumNumberOfThreads);
|
||||
} else {
|
||||
|
||||
@@ -63,11 +63,11 @@ public class NvdCveUpdater implements CachedWebDataSource {
|
||||
/**
|
||||
* The thread pool size to use for CPU-intense tasks.
|
||||
*/
|
||||
private static final int PROCESSING_THREAD_POOL_SIZE = 1;
|
||||
private static final int PROCESSING_THREAD_POOL_SIZE = Runtime.getRuntime().availableProcessors();
|
||||
/**
|
||||
* The thread pool size to use when downloading files.
|
||||
*/
|
||||
private static final int DOWNLOAD_THREAD_POOL_SIZE = Settings.getInt(Settings.KEYS.MAX_DOWNLOAD_THREAD_POOL_SIZE, 50);
|
||||
private static final int DOWNLOAD_THREAD_POOL_SIZE = Math.round(1.5f * Runtime.getRuntime().availableProcessors());
|
||||
/**
|
||||
* ExecutorService for CPU-intense processing tasks.
|
||||
*/
|
||||
@@ -99,16 +99,20 @@ public class NvdCveUpdater implements CachedWebDataSource {
|
||||
}
|
||||
|
||||
try {
|
||||
initializeExecutorServices();
|
||||
cveDb = CveDB.getInstance();
|
||||
dbProperties = cveDb.getDatabaseProperties();
|
||||
boolean autoUpdate = true;
|
||||
try {
|
||||
autoUpdate = Settings.getBoolean(Settings.KEYS.AUTO_UPDATE);
|
||||
} catch (InvalidSettingException ex) {
|
||||
LOGGER.debug("Invalid setting for auto-update; using true.");
|
||||
}
|
||||
if (autoUpdate && checkUpdate()) {
|
||||
if (!autoUpdate) {
|
||||
return;
|
||||
}
|
||||
initializeExecutorServices();
|
||||
cveDb = CveDB.getInstance();
|
||||
dbProperties = cveDb.getDatabaseProperties();
|
||||
|
||||
if (checkUpdate()) {
|
||||
final UpdateableNvdCve updateable = getUpdatesNeeded();
|
||||
if (updateable.isUpdateNeeded()) {
|
||||
performUpdate(updateable);
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
application.name=${pom.name}
|
||||
application.version=${pom.version}
|
||||
autoupdate=true
|
||||
max.download.threads=50
|
||||
|
||||
# the url to obtain the current engine version from
|
||||
engine.version.url=https://jeremylong.github.io/DependencyCheck/current.txt
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
application.name=${pom.name}
|
||||
application.version=${pom.version}
|
||||
autoupdate=true
|
||||
max.download.threads=50
|
||||
|
||||
# the url to obtain the current engine version from
|
||||
engine.version.url=https://jeremylong.github.io/DependencyCheck/current.txt
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
application.name=${pom.name}
|
||||
application.version=${pom.version}
|
||||
autoupdate=true
|
||||
max.download.threads=50
|
||||
|
||||
# the url to obtain the current engine version from
|
||||
engine.version.url=http://jeremylong.github.io/DependencyCheck/current.txt
|
||||
|
||||
Reference in New Issue
Block a user