mirror of
https://github.com/ysoftdevs/DependencyCheck.git
synced 2026-01-15 08:13:43 +01:00
fix issue #783
This commit is contained in:
@@ -516,7 +516,7 @@ public class NvdCveUpdater implements CachedWebDataSource {
|
||||
|
||||
final Map<String, Future<Long>> timestampFutures = new HashMap<>();
|
||||
for (String url : urls) {
|
||||
final TimestampRetriever timestampRetriever = new TimestampRetriever(url);
|
||||
final TimestampRetriever timestampRetriever = new TimestampRetriever(url, Settings.getInstance());
|
||||
final Future<Long> future = downloadExecutorService.submit(timestampRetriever);
|
||||
timestampFutures.put(url, future);
|
||||
}
|
||||
@@ -544,6 +544,10 @@ public class NvdCveUpdater implements CachedWebDataSource {
|
||||
*/
|
||||
private static class TimestampRetriever implements Callable<Long> {
|
||||
|
||||
/**
|
||||
* A reference to the global settings object.
|
||||
*/
|
||||
private final Settings settings;
|
||||
/**
|
||||
* The URL to obtain the timestamp from.
|
||||
*/
|
||||
@@ -553,16 +557,18 @@ public class NvdCveUpdater implements CachedWebDataSource {
|
||||
* Instantiates a new timestamp retriever object.
|
||||
*
|
||||
* @param url the URL to hit
|
||||
* @param settings the global settings
|
||||
*/
|
||||
TimestampRetriever(String url) {
|
||||
TimestampRetriever(String url, Settings settings) {
|
||||
this.url = url;
|
||||
this.settings = settings;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long call() throws Exception {
|
||||
LOGGER.debug("Checking for updates from: {}", url);
|
||||
try {
|
||||
Settings.initialize();
|
||||
Settings.setInstance(settings);
|
||||
return Downloader.getLastModified(new URL(url));
|
||||
} finally {
|
||||
Settings.cleanup(false);
|
||||
|
||||
Reference in New Issue
Block a user