-
Notifications
You must be signed in to change notification settings - Fork 928
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
New state system #945
Merged
Merged
New state system #945
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jo3-l
reviewed
May 24, 2021
This is a new package that provides a pretty simple cache system based on "slots", each cached type has it's own "slot" and managed all the cached values inside it on its own values inside a "slot" are keyed by interface{} so the user can use whatever key type they want but the most common one will probably be int64
MemberState no longer contains roles and nickname, they're in the nested member object this is to increase support for future discord api versions where presences are less usefull
I believe discord has fixed the issues where JoinedAt was not available atleast im not able to find any such cases anymore And with the roles and nick fields being moved to the member fields for dstate.MemberState, all calls to bot.GetMember requires the member field to be set to use the cached version.
This is getting close, there's just a small number of tasks left:
|
jogramming
commented
Jun 3, 2021
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.
finally done going over 147 files
jo3-l
pushed a commit
to jo3-l/yagpdb
that referenced
this pull request
Jun 3, 2021
* initial work on new state system * state: intial version of new state system and basic embedded tracker * progress * more progress * update go.mod * add CacheSet replacement for GuildState.Userstate This is a new package that provides a pretty simple cache system based on "slots", each cached type has it's own "slot" and managed all the cached values inside it on its own values inside a "slot" are keyed by interface{} so the user can use whatever key type they want but the most common one will probably be int64 * more progress moving to the new state and caching sytem * continued work on migrating to the new state and cache system * we compiled now bois * update to latest dcmd and dstate MemberState no longer contains roles and nickname, they're in the nested member object this is to increase support for future discord api versions where presences are less usefull * remove bot.GetMemberJoinedAt as it's not needed I believe discord has fixed the issues where JoinedAt was not available atleast im not able to find any such cases anymore And with the roles and nick fields being moved to the member fields for dstate.MemberState, all calls to bot.GetMember requires the member field to be set to use the cached version. * common: run CacheSet gc loop in goroutine * bot: fix not setting proper state in setupState * automodv2: fix panic in CheckTriggers * tickets: fix build * premium: fix deadlocking state * update to latest dstate * enabled shard migration, added state debug commands * update to latest dshardorchestrator, go mod tidy * accidentally included some compiled files * add a couple more executables to gitignore * memberfetcher: add results to state, properly set guildid * bot: run state gc loop * udpate to latest dstate * templates: fixes and tweaks * fix a bunch of warnings * update to latest dcmd * update to latest dcmd * web: fixes for new state system * botrest: use bot.GetMember to fallback to api * commands: simplify a section * templates: use user reference to keep backwards compat * templates: fix referencing looping var * pubsub: change EvictCacheSet to not require a guildID * undelete: fix build
jo3-l
pushed a commit
to jo3-l/yagpdb
that referenced
this pull request
Jun 3, 2021
* initial work on new state system * state: intial version of new state system and basic embedded tracker * progress * more progress * update go.mod * add CacheSet replacement for GuildState.Userstate This is a new package that provides a pretty simple cache system based on "slots", each cached type has it's own "slot" and managed all the cached values inside it on its own values inside a "slot" are keyed by interface{} so the user can use whatever key type they want but the most common one will probably be int64 * more progress moving to the new state and caching sytem * continued work on migrating to the new state and cache system * we compiled now bois * update to latest dcmd and dstate MemberState no longer contains roles and nickname, they're in the nested member object this is to increase support for future discord api versions where presences are less usefull * remove bot.GetMemberJoinedAt as it's not needed I believe discord has fixed the issues where JoinedAt was not available atleast im not able to find any such cases anymore And with the roles and nick fields being moved to the member fields for dstate.MemberState, all calls to bot.GetMember requires the member field to be set to use the cached version. * common: run CacheSet gc loop in goroutine * bot: fix not setting proper state in setupState * automodv2: fix panic in CheckTriggers * tickets: fix build * premium: fix deadlocking state * update to latest dstate * enabled shard migration, added state debug commands * update to latest dshardorchestrator, go mod tidy * accidentally included some compiled files * add a couple more executables to gitignore * memberfetcher: add results to state, properly set guildid * bot: run state gc loop * udpate to latest dstate * templates: fixes and tweaks * fix a bunch of warnings * update to latest dcmd * update to latest dcmd * web: fixes for new state system * botrest: use bot.GetMember to fallback to api * commands: simplify a section * templates: use user reference to keep backwards compat * templates: fix referencing looping var * pubsub: change EvictCacheSet to not require a guildID * undelete: fix build
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is a draft pr tracking my progress on the new state system.
There's probably still a couple things i will change on the design but the higher level structure of it is set.
As for why there's a new state system can be found here: https://github.com/jonas747/dstate/blob/v3/README.md