System resource cache - #5289
Open
JonoYang wants to merge 11 commits into
Open
Conversation
Signed-off-by: Jono Yang <jyang@nexb.com>
* Use sha256 instead of md5 Signed-off-by: Jono Yang <jyang@nexb.com>
Signed-off-by: Jono Yang <jyang@nexb.com>
Signed-off-by: Jono Yang <jyang@nexb.com>
* Create envvar for controlling whether or not the scan results cache is used Signed-off-by: Jono Yang <jyang@nexb.com>
Signed-off-by: Jono Yang <jyang@nexb.com>
Signed-off-by: Jono Yang <jyang@nexb.com>
Signed-off-by: Jono Yang <jyang@nexb.com>
Signed-off-by: Jono Yang <jyang@nexb.com>
Signed-off-by: Jono Yang <jyang@nexb.com>
| results_cache_index=results_cache_index, | ||
| plugin_name=plugin_name | ||
| ) | ||
| if os.path.exists(results_cache_file_location): |
| plugin_name=plugin_name | ||
| ) | ||
| if os.path.exists(results_cache_file_location): | ||
| with open(results_cache_file_location) as f: |
| results_cache_directory_location = get_results_cache_directory_location( | ||
| results_cache_index=results_cache_index | ||
| ) | ||
| if not os.path.exists(results_cache_directory_location): |
| if not os.path.exists(results_cache_directory_location): | ||
| create_dir(results_cache_directory_location) | ||
| results_cache_file_location = os.path.join(results_cache_directory_location, plugin_name) | ||
| with open(results_cache_file_location, 'w') as f: |
Signed-off-by: Jono Yang <jyang@nexb.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR introduces a cache for the results of scanners run by scancode. The
scancode,scan_codebase, andscan_resourcefunctions have been updated to look for cached scan results to reuse before scanning. The cache is updated after scanning, if it was required.