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(S3ClientProvider): Reduce complexity of generateClient #248

Merged
merged 10 commits into from
Nov 1, 2023

Conversation

guicamest
Copy link
Contributor

@guicamest guicamest commented Oct 31, 2023

Description of changes:

The generateClient (and generateAsyncClient) method was quite complex, had several nested blocks (if/try/if/try/if). Some new methods have been extracted in order to make the code more readable and maintainable.

Both generateClient and generateAsyncClient shared the same logic - except for the underlying client that was generated. A new method getClientForBucket has been extracted that receives a function to construct the client for the given bucket location. The old generateClient has been renamed to generateSyncClient.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

Copy link
Contributor

@markjschreiber markjschreiber left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for tidying up this code

@markjschreiber markjschreiber merged commit f552fd6 into awslabs:main Nov 1, 2023
1 check passed
@guicamest guicamest deleted the generateClientRefactor branch November 1, 2023 13:25
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.

2 participants