Skip to content

Commit

Permalink
Remove checkstyle dependency. Make jedisPool as a configurable at…
Browse files Browse the repository at this point in the history
…tribute
  • Loading branch information
Alex Yang committed Mar 18, 2019
1 parent 6667470 commit a26ef33
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 7 deletions.
3 changes: 2 additions & 1 deletion docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -307,8 +307,9 @@ These 4 Serializers are replaceable:
| maxAttempts | `3` | **Only used for cluster mode**<br>Max attempts to connect to server |
| password | | Redis password |
| database | `0` | Redis database. Default value is 0 |
| jedisPoolConfig | `new redis.clients.jedis.JedisPoolConfig()` | JedisPoolConfig. You can create your own JedisPoolConfig and set attributes as you wish<br>Most of time, you don't need to set jedisPoolConfig<br>Here is an example.<br>`jedisPoolConfig = redis.clients.jedis.JedisPoolConfig`<br>`jedisPoolConfig.testWhileIdle = false`<br>`redisManager.jedisPoolConfig = jedisPoolConfig` |
| jedisPoolConfig | `new redis.clients.jedis.JedisPoolConfig()` | JedisPoolConfig. You can create your own JedisPoolConfig instance and set attributes as you wish<br>Most of time, you don't need to set jedisPoolConfig<br>Here is an example.<br>`jedisPoolConfig = redis.clients.jedis.JedisPoolConfig`<br>`jedisPoolConfig.testWhileIdle = false`<br>`redisManager.jedisPoolConfig = jedisPoolConfig` |
| count | `100` | Scan count. Shiro-redis use Scan to get keys, so you can define the number of elements returned at every iteration. |
| jedisPool | `null` | **Only used for sentinel mode or single mode**<br>You can create your own JedisPool instance and set attributes as you wish |

### RedisSessionDAO

Expand Down
5 changes: 0 additions & 5 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -70,11 +70,6 @@
<version>1.9.5</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.puppycrawl.tools</groupId>
<artifactId>checkstyle</artifactId>
<version>8.3</version>
</dependency>
<dependency>
<groupId>com.github.javafaker</groupId>
<artifactId>javafaker</artifactId>
Expand Down
7 changes: 7 additions & 0 deletions src/main/java/org/crazycake/shiro/RedisSentinelManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -95,4 +95,11 @@ public void setSoTimeout(int soTimeout) {
this.soTimeout = soTimeout;
}

public JedisSentinelPool getJedisPool() {
return jedisPool;
}

public void setJedisPool(JedisSentinelPool jedisPool) {
this.jedisPool = jedisPool;
}
}
2 changes: 1 addition & 1 deletion src/main/java/org/crazycake/shiro/RedisSessionDAO.java
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ private void setSessionToThreadLocal(Serializable sessionId, Session s) {

private void removeExpiredSessionInMemory(Map<Serializable, SessionInMemory> sessionMap) {
Iterator<Serializable> it = sessionMap.keySet().iterator();
while(it.hasNext()) {
while (it.hasNext()) {
Serializable sessionId = it.next();
SessionInMemory sessionInMemory = sessionMap.get(sessionId);
if (sessionInMemory == null) {
Expand Down

0 comments on commit a26ef33

Please sign in to comment.