lyfO_o
2022-07-04 73ad14eba38160802fd986252190fd8b823efc8d
调整
已修改2个文件
15 ■■■■ 文件已修改
safePlatfrom-out-web/src/main/java/com/gkhy/safePlatform/config/redis/RedisUtils.java 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
safePlatfrom-out-web/src/main/resources/config/application-dev.yaml 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
safePlatfrom-out-web/src/main/java/com/gkhy/safePlatform/config/redis/RedisUtils.java
@@ -12,6 +12,7 @@
import org.springframework.data.redis.core.*;
import org.springframework.stereotype.Repository;
import javax.annotation.PostConstruct;
import javax.annotation.Resource;
import java.io.Serializable;
import java.util.HashSet;
@@ -37,6 +38,16 @@
    private final Logger logger = LoggerFactory.getLogger(this.getClass());
    @PostConstruct
    public void initRepository(){
        try {
            this.set("test:module:Web", "testConnection", 60L, TimeUnit.SECONDS);
            logger.info("[ModuleRedis][Web] is connected");
        } catch (Exception e) {
            logger.error("[ModuleRedis][Web] connected failed!!");
        }
    }
    /**
     * 写入缓存
     * @param key
safePlatfrom-out-web/src/main/resources/config/application-dev.yaml
@@ -22,9 +22,9 @@
      password: Adsdf675T6AC7yga
      type: com.alibaba.druid.pool.DruidDataSource
  redis:
    host: 127.0.0.1
    host: 192.168.0.52
    port: 6379
    password: root      # Redis 服务器密码,默认为空。生产中,一定要设置 Redis 密码!
    password: SEF98uvs98dUAUEF90Udssa
    database: 0           # Redis 数据库号,默认为 0
    timeout: 15000        # Redis 连接超时时间,单位:毫秒。
    # 对应 RedisProperties.Jedis 内部类