-
-
Notifications
You must be signed in to change notification settings - Fork 168
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
feat: allow disabling of guild and channel caches #895
Conversation
✅ Deploy Preview for dpp-dev ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
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.
I don't really like the super abbreviated variable names and wish we'd use more explicit naming. Other than that I'm not familiar with the cache system in D++, but looks good to me generally.
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.
Can fix storing the role id vector in another PR. Thanks!
This PR adds support for disabling the guild or channel cache completely, saving potentially gigabytes of ram at scale.
This needs some testing before it can be pushed to dev. I shall be testing it over the next few days.
Note that if you disable a cache, certain events may deliver a nullptr instead of the expected structure, e.g. if you disabled guild cache, on_guild_delete is going to give you nullptr as the guild being deleted as discord do not provide the 'old' data.
I have also added a new namespace dpp::cache_policy that contains three simple constexpr's as shorthand for generic cache policies that people might want to use: default, balanced, or none. Default is what DPP has always used, balanced is what triviabot is using right now and none is what it will use in the future.
users who are exclusively using slash commands and the resolved set there will be able to move to the disabled cache setting with minimal migration difficulty.
Code change checklist