mirror of
https://gitee.com/wangkang/udf.git
synced 2026-11-22 08:13:42 +00:00
清除缓存的逻辑调整
This commit is contained in:
@@ -22,13 +22,11 @@ const glob = {
|
||||
//配置
|
||||
NProgress.configure({easing: 'ease', speed: 500, showSpinner: false});
|
||||
NProgress.inc(0.2);
|
||||
|
||||
//开始遍历
|
||||
router.beforeEach((to, from, next) => {
|
||||
NProgress.start();
|
||||
next();
|
||||
});
|
||||
|
||||
//结束遍历
|
||||
router.afterEach(() => {
|
||||
NProgress.done();
|
||||
|
||||
-7
@@ -2,15 +2,8 @@ package org.itkk.udf.api.common.repository;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.itkk.udf.api.common.entity.TraceInfoEntity;
|
||||
|
||||
@Mapper
|
||||
public interface ITraceInfoRepository extends BaseMapper<TraceInfoEntity> {
|
||||
/**
|
||||
* 清理追踪日志
|
||||
*
|
||||
* @param traceLogKeepDays traceLogKeepDays
|
||||
*/
|
||||
void clearTraceInfo(@Param("traceLogKeepDays") Integer traceLogKeepDays);
|
||||
}
|
||||
|
||||
+6
-1
@@ -1,6 +1,7 @@
|
||||
package org.itkk.udf.api.common.service;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.itkk.udf.api.common.CommonProperties;
|
||||
import org.itkk.udf.api.common.entity.TraceInfoEntity;
|
||||
@@ -12,6 +13,8 @@ import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Propagation;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.time.ZoneId;
|
||||
import java.util.Date;
|
||||
import java.util.UUID;
|
||||
|
||||
@@ -40,7 +43,9 @@ public class TraceInfoService {
|
||||
* 定时清理追踪日志
|
||||
*/
|
||||
public void clearTraceInfo() {
|
||||
iTraceInfoRepository.clearTraceInfo(commonProperties.getTraceLogKeepDays());
|
||||
LocalDate nextDay = LocalDate.now().minusDays(commonProperties.getTraceLogKeepDays());
|
||||
Date date = Date.from(nextDay.atStartOfDay(ZoneId.systemDefault()).toInstant());
|
||||
iTraceInfoRepository.delete(new UpdateWrapper<TraceInfoEntity>().lambda().le(TraceInfoEntity::getCreateDate, date));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,9 +1,4 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="org.itkk.udf.api.common.repository.ITraceInfoRepository">
|
||||
<delete id="clearTraceInfo">
|
||||
DELETE
|
||||
FROM TM_COMMON_TRACE_INFO A
|
||||
WHERE A.CREATE_DATE <![CDATA[ <= ]]> date_sub(current_timestamp, INTERVAL #{traceLogKeepDays} day)
|
||||
</delete>
|
||||
</mapper>
|
||||
|
||||
Reference in New Issue
Block a user