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

refactor: Unify logic for generating Redis keys #807

Merged
merged 4 commits into from
Jul 9, 2024

Conversation

morgsmccauley
Copy link
Collaborator

@morgsmccauley morgsmccauley commented Jun 18, 2024

Both the IndexerState and IndexerConfig structs are used individually to access Redis, and therefore have duplicate code for generating the required keys. This is problematic for the following reasons:

  1. Redis access is limited to these structs, anything else requiring access needs to duplicate the logic again
  2. Updates need to be reflected across both structs, creating more room for error

This PR creates a common Redis KeyProvider interface/trait for accessing Indexer Redis data/keys. Now the required structs, i.e. IndexerState and IndexerConfig, can implement this trait, and automatically get access to the methods which generate the keys.

Also did some minor clean up, removing the old Coordinator migration code.

@morgsmccauley morgsmccauley force-pushed the refactor/common-redis-keys branch 2 times, most recently from 566051a to 2e30984 Compare June 21, 2024 04:13
@morgsmccauley morgsmccauley changed the title Refactor/common redis keys refactor: Unify logic for generating Redis keys Jul 7, 2024
@morgsmccauley morgsmccauley marked this pull request as ready for review July 7, 2024 22:51
@morgsmccauley morgsmccauley requested a review from a team as a code owner July 7, 2024 22:51
@morgsmccauley morgsmccauley merged commit 680c6c9 into main Jul 9, 2024
4 checks passed
@morgsmccauley morgsmccauley deleted the refactor/common-redis-keys branch July 9, 2024 20:32
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.

1 participant