-
Notifications
You must be signed in to change notification settings - Fork 7
Fix clear cache to clear valkey instead of filesystem cache #1234
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
Conversation
f8b4801
to
67df831
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems to work! No clue what's happening in the preview env tho
Failing to load env vars :(. |
my guess is that that will also not work, could you not do |
if that also doesn't work i'd just write a separate script 😅 |
I think what I have now should work. I'm using
|
Issue(s) Resolved
Resolves #1233
High-level Explanation of PR
After #1131 we no longer cache data on the filesystem, and instead store it in redis. In both local development and in the sandbox deployments, we regularly run the reset command, which also attempts to clear the cache. Since that cache-clearing function wasn't working, we could end up with stale data in the sandbox cache.
Test Plan
It's easiest to see this clear the cache if you install redis-cli (or some kind of gui redis app).
redis-cli
monitor will let you see commands as they come in, andredis cli scan 100
will print 100 keys so you can see if there's data in the cache.pnpm -w dev:cache:start
) and after using the app a bit, runredis cli scan 100
to show there's data in the cacheredis-cli monitor
in a separate terminalpnpm clear-cache
To actually recreate the initial sandbox bug requires a bit more effort, since you need to check out a previous commit (
1c21713d4321f728ee4b6362f2b63675542868c1
) and run reset.I've also confirmed that this reset succeeds on lightsail by sshing into the preview instance for this branch and confirming that the migrations container exits with status 0 and that you can see the cache clearing command run in the logs for that container.
Notes
I don't think this is an issue in prod. My guess is the reason we're seeing strange behavior is that the seed scripts have a mixture of hardcoded and generated data, so we end up with some cache hits to stale data after reset. But that doesn't entirely make sense, so lmk if you have other ideas.