diff --git a/src/main/java/cn/danielw/fop/PoolConfig.java b/src/main/java/cn/danielw/fop/PoolConfig.java index ead61ce..76ade7e 100755 --- a/src/main/java/cn/danielw/fop/PoolConfig.java +++ b/src/main/java/cn/danielw/fop/PoolConfig.java @@ -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;