Skip to content

Commit

Permalink
Make ldap pool period and idle time configurable (#2091)
Browse files Browse the repository at this point in the history
  • Loading branch information
Martin-Kemp authored Sep 21, 2022
1 parent f591af6 commit 1fc02ad
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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() {

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down

0 comments on commit 1fc02ad

Please sign in to comment.