diff --git a/src/main/java/com/amazon/dlic/auth/ldap/util/ConfigConstants.java b/src/main/java/com/amazon/dlic/auth/ldap/util/ConfigConstants.java index 64cc868d83..806e542c08 100755 --- a/src/main/java/com/amazon/dlic/auth/ldap/util/ConfigConstants.java +++ b/src/main/java/com/amazon/dlic/auth/ldap/util/ConfigConstants.java @@ -82,6 +82,9 @@ public final class ConfigConstants { public static final String LDAP_POOL_TYPE = "pool.type"; + public static final String LDAP_POOL_PRUNING_PERIOD = "pool.pruning_period"; + public static final String LDAP_POOL_IDLE_TIME = "pool.idle_time"; + private ConfigConstants() { } diff --git a/src/main/java/com/amazon/dlic/auth/ldap2/LDAPConnectionFactoryFactory.java b/src/main/java/com/amazon/dlic/auth/ldap2/LDAPConnectionFactoryFactory.java index 79936e5b12..74d8989ae3 100644 --- a/src/main/java/com/amazon/dlic/auth/ldap2/LDAPConnectionFactoryFactory.java +++ b/src/main/java/com/amazon/dlic/auth/ldap2/LDAPConnectionFactoryFactory.java @@ -127,8 +127,11 @@ public ConnectionPool createConnectionPool() { } result.setValidator(getConnectionValidator()); - result.setPruneStrategy(new IdlePruneStrategy(Duration.ofMinutes(this.settings.getAsLong("pruning.period", 5l)), - Duration.ofMinutes(this.settings.getAsLong("pruning.idleTime", 10l)))); + + result.setPruneStrategy(new IdlePruneStrategy( + Duration.ofMinutes(this.settings.getAsLong(ConfigConstants.LDAP_POOL_PRUNING_PERIOD, this.settings.getAsLong("pruning.period", 5l))), + Duration.ofMinutes(this.settings.getAsLong(ConfigConstants.LDAP_POOL_IDLE_TIME, this.settings.getAsLong("pruning.idleTime", 10l)))) + ); result.initialize();