记得上下班打卡 | git大法好,push需谨慎

Commit 85ee7fda authored by wangyifan's avatar wangyifan

缓存改造-stone:item:logs:list 增加缓存过期时间

parent be4e24f6
......@@ -10,4 +10,7 @@ public class RedisKeyExpireConst {
// kylin:order:id 过期时间为10天
public static final long KYLIN_ORDER_ID_EXPIRE = 10 * 24 * 60 * 60;
// stone:item:logs:list 过期时间为10天
public static final long STONE_ITEM_LOGS_LIST_EXPIRE = 10 * 24 * 60 * 60;
}
package com.liquidnet.service.stone.util;
import com.liquidnet.common.cache.redis.util.RedisUtil;
import com.liquidnet.service.base.constant.RedisKeyExpireConst;
import com.liquidnet.service.stone.constant.StoneConstant;
import com.liquidnet.service.stone.entity.StoneScoreItems;
import com.liquidnet.service.stone.entity.StoneScoreLogs;
......@@ -225,7 +226,7 @@ public class StoneRedisUtils {
dataList.remove(40);
}
}
redisUtil.set(redisKey, dataList);
redisUtil.set(redisKey, dataList, RedisKeyExpireConst.STONE_ITEM_LOGS_LIST_EXPIRE);
}
/**
......@@ -236,7 +237,7 @@ public class StoneRedisUtils {
Object obj = redisUtil.get(redisKey);
if (obj == null) {
List<StoneScoreLogs> getLogsList = (List<StoneScoreLogs>) mongoUtils.logList(uid, 1, 40).get("data");
redisUtil.set(redisKey, getLogsList);
redisUtil.set(redisKey, getLogsList, RedisKeyExpireConst.STONE_ITEM_LOGS_LIST_EXPIRE);
return getLogsList;
} else {
return (List<StoneScoreLogs>) obj;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment