Skip to content

Improve Cache #5

Description

@tobiasschweizer
def write_records_to_cache(records: List, key: Union[str, int], value: Union[str, int], cache_dir: Path):
    with Cache(directory=str(cache_dir), size_limit=CACHE_MAX_SIZE) as cache_ref:
        for rec in records:
            write_record_to_cache(rec[key], rec[value], cache_dir)

Do not call write_record_to_cache whithin write_records_to_cache as this creates a new reference to the cache each time. Instead, directly write to cache with the given reference.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions