-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Replace deprecated interface with new interface of JedisPoolConfig (#…
…2749) * Replace old interface with new interface of JedisPoolConfig * Replace old interface with new interface of ConnectionPoolConfig * reorder import * reorder import Co-authored-by: M Sazzadul Hoque <[email protected]>
- Loading branch information
Showing
2 changed files
with
6 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,15 @@ | ||
package redis.clients.jedis; | ||
|
||
import java.time.Duration; | ||
import org.apache.commons.pool2.impl.GenericObjectPoolConfig; | ||
|
||
public class ConnectionPoolConfig extends GenericObjectPoolConfig<Connection> { | ||
|
||
public ConnectionPoolConfig() { | ||
// defaults to make your life with connection pool easier :) | ||
setTestWhileIdle(true); | ||
setMinEvictableIdleTimeMillis(60000); | ||
setTimeBetweenEvictionRunsMillis(30000); | ||
setMinEvictableIdleTime(Duration.ofMillis(60000)); | ||
setTimeBetweenEvictionRuns(Duration.ofMillis(30000)); | ||
setNumTestsPerEvictionRun(-1); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,15 @@ | ||
package redis.clients.jedis; | ||
|
||
import java.time.Duration; | ||
import org.apache.commons.pool2.impl.GenericObjectPoolConfig; | ||
|
||
public class JedisPoolConfig extends GenericObjectPoolConfig<Jedis> { | ||
|
||
public JedisPoolConfig() { | ||
// defaults to make your life with connection pool easier :) | ||
setTestWhileIdle(true); | ||
setMinEvictableIdleTimeMillis(60000); | ||
setTimeBetweenEvictionRunsMillis(30000); | ||
setMinEvictableIdleTime(Duration.ofMillis(60000)); | ||
setTimeBetweenEvictionRuns(Duration.ofMillis(30000)); | ||
setNumTestsPerEvictionRun(-1); | ||
} | ||
} |