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

Fixed the CacheCheck causing race conditions in some cases #205

Merged
merged 2 commits into from
Dec 5, 2023

Conversation

jonnyka
Copy link
Contributor

@jonnyka jonnyka commented Dec 4, 2023

If you have multiple environments, like subdeployments, and you run the CacheCheck, it can cause race conditions, because multiple environments write / read the same cache key (laravel-health:check).

By adding the random string from the test cache value to the key itself, we can avoid that race condition.

Also added Cache->forget(), so we don't flood the cache with all those randomized keys.

@freekmurze freekmurze merged commit 4e4ab00 into spatie:main Dec 5, 2023
6 checks passed
@freekmurze
Copy link
Member

Thanks!

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