From cbda3581b252c96dc4077fd4744ab5b6e6f438de Mon Sep 17 00:00:00 2001 From: githubname1024 Date: Mon, 5 Aug 2024 10:58:50 +0800 Subject: [PATCH] cachecloud 3.3 --- .../com/sohu/cache/redis/impl/AssistRedisServiceImpl.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/cachecloud-web/src/main/java/com/sohu/cache/redis/impl/AssistRedisServiceImpl.java b/cachecloud-web/src/main/java/com/sohu/cache/redis/impl/AssistRedisServiceImpl.java index eb9b3daa..fd56f44e 100755 --- a/cachecloud-web/src/main/java/com/sohu/cache/redis/impl/AssistRedisServiceImpl.java +++ b/cachecloud-web/src/main/java/com/sohu/cache/redis/impl/AssistRedisServiceImpl.java @@ -3,6 +3,7 @@ import com.sohu.cache.redis.AssistRedisService; import com.sohu.cache.redis.util.Command; import com.sohu.cache.redis.util.ProtostuffSerializer; +import org.apache.commons.lang.StringUtils; import org.apache.commons.pool2.impl.GenericObjectPoolConfig; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -44,7 +45,12 @@ public class AssistRedisServiceImpl implements AssistRedisService { @PostConstruct public void init() { GenericObjectPoolConfig config = new GenericObjectPoolConfig(); - jedisPoolMain = new JedisPool(config, mainHost, mainPort, Protocol.DEFAULT_TIMEOUT, mainPassword); + if(StringUtils.isNotBlank(mainPassword)){ + jedisPoolMain = new JedisPool(config, mainHost, mainPort, Protocol.DEFAULT_TIMEOUT, mainPassword); + }else{ + logger.error("The assist redis password is not configured, please confirm and strongly recommend config it."); + jedisPoolMain = new JedisPool(config, mainHost, mainPort, Protocol.DEFAULT_TIMEOUT); + } } /**