-
Notifications
You must be signed in to change notification settings - Fork 16
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
chore: add cache cleaner #66
base: main
Are you sure you want to change the base?
Conversation
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.
Why do we save wrong cached data? This is just for development, in that case, we can easily modify the folder name with VOTE_REPORT_SUBDIR
env right?
It’s for rare cases, when the cached data are wrong, like some edge cases we did not foreseen. |
Either way, the function to delete files is not wasted, and will be reused in #80 |
And in cases where cached files contains error, even if we change the cache dir, we still need to clear those files to reduce cost |
I feel like it is very easy to delete/rename files on AWS/DO spaces. can merge this but just worried about the unwanted code 🙈 |
You can, when you have access 🙈 |
🧿 Current issues / What's wrong ?
There is now way to delete all cached contents, in case there was an issue, producing bugged cached contents.
💊 Fixes / Solution
Add a dev script to manually trigger cache clearing. Script only for dev use, and can not be run on prod.
🚧 Changes
🛠️ Tests
Recommend to set your storage engine to
file
, and add some dummy files totmp/votes
.yarn ts-node scripts/list-cache.ts
to list the cache contentsyarn ts-node scripts/clear-cache.ts
to clear the cache