Skip to content

fix: store timestamps locally for local resources#6936

Merged
jeremylong merged 4 commits intomainfrom
scratch/local-data
Sep 4, 2024
Merged

fix: store timestamps locally for local resources#6936
jeremylong merged 4 commits intomainfrom
scratch/local-data

Conversation

@jeremylong
Copy link
Copy Markdown
Collaborator

Fixes Issue jeremylong/DependencyCheck#6434

Store last updated timestamps locally for local, file-based resources.

@boring-cyborg boring-cyborg Bot added the core changes to core label Aug 30, 2024
@jeremylong jeremylong linked an issue Aug 30, 2024 that may be closed by this pull request
Comment thread core/src/main/java/org/owasp/dependencycheck/data/update/LocalDataSource.java Outdated
Copy link
Copy Markdown
Collaborator

@aikebah aikebah left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, though (on this second read)... it might be worth considering refactoring the

            if (lastUpdatedOn <= 0) {
                //fall back on conversion from file last modified to storing in the db.
                lastUpdatedOn = repo.lastModified();
            }

into the getLastUpdated method of the LocalDataSource rather than repeating it in each subclass as a fallback when not getting a lastUpdated back from the call.

@jeremylong jeremylong added this to the 11.0.0 milestone Sep 4, 2024
@jeremylong jeremylong merged commit c53d4a4 into main Sep 4, 2024
@jeremylong jeremylong deleted the scratch/local-data branch September 4, 2024 12:47
@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Dec 6, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

core changes to core

Projects

None yet

Development

Successfully merging this pull request may close these issues.

up to date check for file based data sources broken

2 participants