linkcheck.cache.results

Cache check results.

Classes

ResultCache(result_cache_size)

Thread-safe cache of UrlData.to_wire() results.

class linkcheck.cache.results.ResultCache(result_cache_size)[source]

Bases: object

Thread-safe cache of UrlData.to_wire() results. the cache is limited in size since we rather recheck the same URL multiple times instead of running out of memory. format: {cache key (string) -> result (UrlData.towire())}

Initialize result cache.

add_result(**kwargs)[source]

Add result object to cache with given key. The request is ignored when the cache is already full or the key is None.

get_result(**kwargs)[source]

Return cached result or None if not found.

has_non_empty_result(key)[source]

Non-thread-safe function for fast containment checks.

has_result(key)[source]

Non-thread-safe function for fast containment checks.