This is an automated email from the ASF dual-hosted git repository.

adamsaghy pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/fineract.git


The following commit(s) were added to refs/heads/develop by this push:
     new 435f75b6c FINERACT-1724: Fix for closing the AWS credentials provider 
unnecessarily upon startup
435f75b6c is described below

commit 435f75b6c0b8a7d67990be18083ec7c295e10068
Author: Arnold Galovics <[email protected]>
AuthorDate: Wed Aug 30 09:46:19 2023 +0200

    FINERACT-1724: Fix for closing the AWS credentials provider unnecessarily 
upon startup
---
 .../apache/fineract/infrastructure/s3/AmazonS3ConfigCondition.java  | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git 
a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/s3/AmazonS3ConfigCondition.java
 
b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/s3/AmazonS3ConfigCondition.java
index 5a607f94c..b9c336ff0 100644
--- 
a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/s3/AmazonS3ConfigCondition.java
+++ 
b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/s3/AmazonS3ConfigCondition.java
@@ -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) {

Reply via email to