From 2453546605d85706c42d8a50239c1bf96c2a7f00 Mon Sep 17 00:00:00 2001
From: java110 <928255095@qq.com>
Date: 星期二, 11 七月 2023 12:20:24 +0800
Subject: [PATCH] 优化问卷题目
---
java110-utils/src/main/java/com/java110/utils/cache/CommonCache.java | 13 ++++++++++++-
1 files changed, 12 insertions(+), 1 deletions(-)
diff --git a/java110-utils/src/main/java/com/java110/utils/cache/CommonCache.java b/java110-utils/src/main/java/com/java110/utils/cache/CommonCache.java
old mode 100644
new mode 100755
index 11f3a2c..9f63c2b
--- a/java110-utils/src/main/java/com/java110/utils/cache/CommonCache.java
+++ b/java110-utils/src/main/java/com/java110/utils/cache/CommonCache.java
@@ -1,12 +1,16 @@
package com.java110.utils.cache;
-import redis.clients.jedis.Jedis;
+import com.java110.utils.util.DateUtil;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import com.java110.utils.cache.Jedis;
/**
* Created by wuxw on 2018/5/5.
*/
public class CommonCache extends BaseCache {
+ private final static Logger logger = LoggerFactory.getLogger(MappingCache.class);
public final static int defaultExpireTime = 5 * 60;
public final static int RESEND_DEFAULT_EXPIRETIME = 1 * 60;
@@ -23,6 +27,8 @@
*/
public static String getValue(String key) {
Jedis redis = null;
+ long startTime = DateUtil.getCurrentDate().getTime();
+
try {
redis = getJedis();
return redis.get(key);
@@ -30,6 +36,7 @@
if (redis != null) {
redis.close();
}
+ logger.debug( key + " redis 鑰楁椂锛�" + (DateUtil.getCurrentDate().getTime() - startTime));
}
}
@@ -41,6 +48,8 @@
public static String getAndRemoveValue(String key) {
Jedis redis = null;
String value = "";
+ long startTime = DateUtil.getCurrentDate().getTime();
+
try {
redis = getJedis();
value = redis.get(key);
@@ -49,6 +58,8 @@
if (redis != null) {
redis.close();
}
+ logger.debug( key + "getAndRemoveValue redis 鑰楁椂锛�" + (DateUtil.getCurrentDate().getTime() - startTime));
+
}
return value;
}
--
Gitblit v1.8.0