Skip to content

Commit

Permalink
Merge pull request #39 from ianroberts/allow-zero-scavenge-interval
Browse files Browse the repository at this point in the history
Permit a zero value for the scavenge interval configuration option
  • Loading branch information
DanielYWoo authored Oct 17, 2021
2 parents 7b5932e + 8217e8f commit 902cc54
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/main/java/cn/danielw/fop/PoolConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,9 @@ public int getScavengeIntervalMilliseconds() {
* @return the pool config
*/
public PoolConfig setScavengeIntervalMilliseconds(int scavengeIntervalMilliseconds) {
if (scavengeIntervalMilliseconds < 5000) {
if (scavengeIntervalMilliseconds != 0 && scavengeIntervalMilliseconds < 5000) {
throw new IllegalArgumentException("Cannot set interval too short (" + scavengeIntervalMilliseconds +
"), must be at least 5 seconds");
"), must be at least 5 seconds, or zero to disable scavenger");
}
this.scavengeIntervalMilliseconds = scavengeIntervalMilliseconds;
return this;
Expand Down

0 comments on commit 902cc54

Please sign in to comment.