Move maxConnections into RDSClientConfig, move creation of RDSClientConfig #2817
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.
What does this change?
This is a straight refactor.
Previously, RDSBuilder.buildDB took a typespace Config, built an RDSClientConfig from it, then later on pulled out the maxConnections from the Config, and used that value alongside the RDSClientConfig. Later still, Main also builds RDSClientConfig from the Config, to pass in to the Worker Service.
This change minimises that duplication, and also clarifies the buildDB interface, by removing the "here's a stringly-keyed dictionary which I hope has all the values you want" approach.
How to test
As a straight refactor, everything should continue working as before.
How can we measure success?
This is part of some refactoring other facilitate wellcomecollection/platform#5888
There is a little inconsistency in the ID Minter about where certain things happen. This is one step towards bringing the configuration aspect in line with the other services we have converted to Lambda.
Have we considered potential risks?
The code in Main is a little undertested, but this is a fairly minimal change, and I've added comprehensive testing to RDSBuilder and RDSClientConfig.