Skip to content

System resource cache - #5289

Open
JonoYang wants to merge 11 commits into
developfrom
system-resource-cache
Open

System resource cache#5289
JonoYang wants to merge 11 commits into
developfrom
system-resource-cache

Conversation

@JonoYang

Copy link
Copy Markdown
Member

This PR introduces a cache for the results of scanners run by scancode. The scancode, scan_codebase, and scan_resource functions have been updated to look for cached scan results to reuse before scanning. The cache is updated after scanning, if it was required.

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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants