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

Invalidate individual models so they can be unique on the queue #14

Merged
merged 4 commits into from
Aug 26, 2024

Conversation

ryanmitchell
Copy link
Contributor

This PR makes the InvalidateAutoCache job unique on the queue and switches from invalidating chunks to invalidating individual AutoCache models on the queue with a new InvalidateAutoCacheModel job, which are also unique on the queue.

This is an attempt to get around what we think is a race condition that is causing Autocache to become out of sync with the cached files.

Copy link

what-the-diff bot commented Aug 26, 2024

PR Summary

  • Implemented Unique Interface in InvalidateAutoCache Classes
    An interface named ShouldBeUnique has been integrated into the InvalidateAutoCache and InvalidateAutoCacheModel operations. Located in the src/Jobs directory, this interface guarantees that these operations always maintain uniqueness.

  • Renamed File for Better Clarity
    The earlier file named InvalidateAutoCacheChunk.php in the src/Jobs directory is now InvalidateAutoCacheModel.php to better match its functionality in the software and for ease of identification.

  • Removed Unnecessary Static Cache Calls
    The src/ServiceProvider.php file had reference to StaticCache which was not been used. To keep the code cleaner and more efficient, this unused reference has been removed.

  • Updated Cache Invalidation in Store Manager
    In the src/Store/Manager.php file, the old InvalidateAutoCacheChunk is replaced with InvalidateAutoCacheModel. Furthermore, a new method called invalidateModel has been introduced, and the old invalidateModels method has been marked as deprecated. These changes represent an effort to streamline and modernize how the software handles cache invalidation.

@sylvesterdamgaard sylvesterdamgaard merged commit 27a3247 into main Aug 26, 2024
1 check passed
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

Successfully merging this pull request may close these issues.

2 participants