Skip to content

Add file-based locking to cache files #34

Description

@fluffy-critter

To better support concurrency, add a Cache.lock primitive which would look something like

with cache.lock(prefix, url) as lock:
    previous = lock.get(schema_version)
    # ...
    lock.save(current)

While a lock is held on a file, any other attempt at acquiring that lock should block.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    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