From fee66fde68610850d4c8c52df022b9d53a0cd3f7 Mon Sep 17 00:00:00 2001
From: zhangfeng <1603559716@qq.com>
Date: 星期三, 21 九月 2022 14:40:34 +0800
Subject: [PATCH] Merge branch 'master' of https://sinanoaq.cn:8888/r/safePlatform-out into zf
---
safePlatfrom-out-web/src/main/java/com/gkhy/safePlatform/config/redis/RedisUtils.java | 11 +++++++++++
1 files changed, 11 insertions(+), 0 deletions(-)
diff --git a/safePlatfrom-out-web/src/main/java/com/gkhy/safePlatform/config/redis/RedisUtils.java b/safePlatfrom-out-web/src/main/java/com/gkhy/safePlatform/config/redis/RedisUtils.java
index 08fe8f7..d185143 100644
--- a/safePlatfrom-out-web/src/main/java/com/gkhy/safePlatform/config/redis/RedisUtils.java
+++ b/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
--
Gitblit v1.9.2