-
Notifications
You must be signed in to change notification settings - Fork 16
BCDA-9314: refactor API db connection globals #1171
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
Merged
Merged
Changes from all commits
Commits
Show all changes
30 commits
Select commit
Hold shift + click to select a range
8e1176c
BCDA-9287: create struct to wrap db connections
michaeljvaldes bd4a313
Pass db connections explicitly from cli to service
michaeljvaldes ca1b0f1
Remove unintended change to middleware
michaeljvaldes bb1fd60
Separate connection and pool
michaeljvaldes 6aa2fa2
Pass connection through routers and services instead of combined struct
michaeljvaldes cab0a71
Add connection as dependency of data router
michaeljvaldes 0d37ba1
Pass connection as argument to token job middleware
michaeljvaldes ed1783c
Remove connection global from cli
michaeljvaldes 8272973
Define db pool as dependency for apis and workers
michaeljvaldes e30cd6e
Remove connection globals from several tests
michaeljvaldes 82c98f0
Pass connection to health.go
michaeljvaldes 134d8fb
Refactor connection globals in cclf
michaeljvaldes 607ce18
Refactor connection global in admin create group lambda
michaeljvaldes 2749820
Refactor db globals in optout lambda
michaeljvaldes db96700
Refactor globals in ratelimit middleware
michaeljvaldes 3256641
Refactor db connection in worker and river
michaeljvaldes ae8dc98
Refactor db connections in cleanup worker
michaeljvaldes 486f0c4
Inject provider as dependency
michaeljvaldes c896f87
Refactor provider-related tests
michaeljvaldes 7376ff3
Merge branch 'main' into mvaldes/BCDA-9287-Connection
michaeljvaldes 29ba3cc
Remove database connection globals
michaeljvaldes b00818b
Rename connection to db
michaeljvaldes 1237279
Remove comments
michaeljvaldes beb66ca
Pass repo as argument in cli function
michaeljvaldes a54157f
Pass globals as arguments in cli functions
michaeljvaldes 49b753b
Run test scenarios as separate tests
michaeljvaldes 16dd65f
Rename blacklist to denylist in a few places
michaeljvaldes cfb33ef
Add comment for refactoring todo
michaeljvaldes 01bd874
Merge branch 'main' into mvaldes/BCDA-9287-Connection
michaeljvaldes bd29e55
Add unit test for pool connection
michaeljvaldes File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
Oops, something went wrong.
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.
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 see all handlers and APIvX passing around pool, but I dont see it being used anywhere? Is this preparation for swapping out db? Or did I miss it somewhere?
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.
Yes, I think the handler passes it to its enqueuer, which then passes it to its river client. As far as I can tell, I only replaced existing instances of the global pool with the pool passed as a dependency.
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 added a PR comment on
enqueue.goto make it a little clearer.