Skip to content

Make clients caches thread safe. #372

@CharString

Description

@CharString

@SilviaAmAm Another thing that just sprang to mind: functools.cache and functools.lru_cache are thread-safe. But I'm unsure if APIClient is; I doubt it's safe to have separate threads do a with client(): ... when they're the same APIClient instance... Now that I've written it down, I even highly doubt it. 😅.

It it isn't a fix is fairly simple. Have client() always return a freshly built instance, "move up" the cache a step.

Originally posted by @CharString in maykinmedia/open-archiefbeheer#881 (comment)

See implementation in maykinmedia/open-archiefbeheer@d99e033

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions