Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cache is never set to Initialized #26

Open
Vlix opened this issue Dec 31, 2024 · 0 comments
Open

Cache is never set to Initialized #26

Vlix opened this issue Dec 31, 2024 · 0 comments

Comments

@Vlix
Copy link

Vlix commented Dec 31, 2024

I've looked through the source code, and the Uninitialized case does say:

-- The cache is uninitialized. Mark the cache as initializing to block other
-- threads. Initialize and return.
Uninitialized -> pure (refreshCache Uninitialized cachedT)

But as you see, below it, it just refreshes the cache.
There's only two spots where Initialized is even written in the code (excluding the comment) and that is in the definition and the case.

I'm not completely sure if adding writeTVar Initialized cachedT is all that's needed. It does seem like giving the refreshCache function Uninitialized as previousState would ensure it should be reset on getting an exception. So might be an easy fix? 🤔

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant