MCPcopy Create free account
hub / github.com/aboutcode-org/scancode-toolkit / populate_cache

Function populate_cache

src/licensedcode/cache.py:413–435  ·  view source on GitHub ↗

Return, load or build and cache a LicenseCache.

(
    only_builtin=False,
    force=False,
    index_all_languages=False,
    additional_directory=None
)

Source from the content-addressed store, hash-verified

411
412
413def populate_cache(
414 only_builtin=False,
415 force=False,
416 index_all_languages=False,
417 additional_directory=None
418):
419 """
420 Return, load or build and cache a LicenseCache.
421 """
422 global _LICENSE_CACHE
423
424 if force or not _LICENSE_CACHE:
425 _LICENSE_CACHE = LicenseCache.load_or_build(
426 only_builtin=only_builtin,
427 licensedcode_cache_dir=licensedcode_cache_dir,
428 scancode_cache_dir=scancode_cache_dir,
429 force=force,
430 index_all_languages=index_all_languages,
431 # used for testing only
432 timeout=LICENSE_INDEX_LOCK_TIMEOUT,
433 additional_directory=additional_directory,
434 )
435 return _LICENSE_CACHE
436
437
438def load_cache_file(cache_file):

Callers 2

setupMethod · 0.90
get_cacheFunction · 0.85

Calls 1

load_or_buildMethod · 0.45

Tested by

no test coverage detected