Skip to content

Commit

Permalink
Merge pull request #21 from Edinjohn/master
Browse files Browse the repository at this point in the history
修复Redis密码不为空的问题
  • Loading branch information
dolyw authored May 10, 2019
2 parents 55f76bf + b010212 commit 0987af4
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/main/java/com/wang/config/redis/JedisConfig.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.wang.config.redis;

import com.wang.util.common.StringUtil;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Value;
Expand Down Expand Up @@ -57,7 +58,8 @@ public JedisPool redisPoolFactory() {
jedisPoolConfig.setMaxTotal(maxActive);
jedisPoolConfig.setMinIdle(minIdle);
// JedisPool jedisPool = new JedisPool(jedisPoolConfig, host, port, timeout, password);
JedisPool jedisPool = new JedisPool(jedisPoolConfig, host, port, timeout, null);
String pwd = StringUtil.isBlank(password) ? null : password;
JedisPool jedisPool = new JedisPool(jedisPoolConfig, host, port, timeout, pwd);
LOGGER.info("初始化Redis连接池JedisPool成功!地址: " + host + ":" + port);
return jedisPool;
} catch (Exception e) {
Expand Down

0 comments on commit 0987af4

Please sign in to comment.