Skip to content

Commit

Permalink
Make ldap pool period and idle time configurable
Browse files Browse the repository at this point in the history
  • Loading branch information
Martin Kemp committed Sep 15, 2022
1 parent 7f992eb commit 7b56841
Show file tree
Hide file tree
Showing 2 changed files with 5 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,8 @@ 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, 5l)),
Duration.ofMinutes(this.settings.getAsLong(ConfigConstants.LDAP_POOL_IDLE_TIME, 10l))));

result.initialize();

Expand Down

0 comments on commit 7b56841

Please sign in to comment.