FINERACT-1724: Fix for closing the AWS credentials provider unnecessarily upon startup
This commit is contained in:
committed by
Adam Saghy
parent
63d6cb38ab
commit
435f75b6c0
+4
-2
@@ -34,8 +34,10 @@ public class AmazonS3ConfigCondition extends PropertiesCondition {
|
||||
}
|
||||
|
||||
private boolean isAwsCredentialValid() {
|
||||
try (var defaultCredentialsProvider = DefaultCredentialsProvider.create()) {
|
||||
defaultCredentialsProvider.resolveCredentials();
|
||||
try {
|
||||
// The credentials provider is intentionally not closed here since Spring will close it at the
|
||||
// context closure event
|
||||
DefaultCredentialsProvider.create().resolveCredentials();
|
||||
DefaultAwsRegionProviderChain.builder().build().getRegion();
|
||||
return true;
|
||||
} catch (Exception e) {
|
||||
|
||||
Reference in New Issue
Block a user