Skip to content

Commit

Permalink
Merge pull request #1557 from mulder999/master
Browse files Browse the repository at this point in the history
Reverse order of import to load latest issues first after start/boot
  • Loading branch information
stevespringett authored Apr 24, 2022
2 parents e6f190c + c9692eb commit ceb5b21
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/main/java/org/dependencytrack/tasks/NistMirrorTask.java
Original file line number Diff line number Diff line change
Expand Up @@ -127,15 +127,15 @@ public void inform(final Event e) {
private void getAllFiles() {
final Date currentDate = new Date();
LOGGER.info("Downloading files at " + currentDate);
for (int i = START_YEAR; i <= END_YEAR; i++) {
// Download JSON 1.1 year feeds
doDownload(this.nvdFeedsUrl + CVE_JSON_11_MODIFIED_URL, ResourceType.CVE_MODIFIED_DATA);
doDownload(this.nvdFeedsUrl + CVE_JSON_11_MODIFIED_META, ResourceType.CVE_META);
for (int i = END_YEAR; i >= START_YEAR; i--) {
// Download JSON 1.1 year feeds in reverse order
final String json11BaseUrl = this.nvdFeedsUrl + CVE_JSON_11_BASE_URL.replace("%d", String.valueOf(i));
final String cve11BaseMetaUrl = this.nvdFeedsUrl + CVE_JSON_11_BASE_META.replace("%d", String.valueOf(i));
doDownload(json11BaseUrl, ResourceType.CVE_YEAR_DATA);
doDownload(cve11BaseMetaUrl, ResourceType.CVE_META);
}
doDownload(this.nvdFeedsUrl + CVE_JSON_11_MODIFIED_URL, ResourceType.CVE_MODIFIED_DATA);
doDownload(this.nvdFeedsUrl + CVE_JSON_11_MODIFIED_META, ResourceType.CVE_META);

if (mirroredWithoutErrors) {
Notification.dispatch(new Notification()
Expand Down

0 comments on commit ceb5b21

Please sign in to comment.