From 97f3c16ac595493405e8cf76399dc703c088ef6f Mon Sep 17 00:00:00 2001 From: liriming <1343021927@qq.com> Date: 星期二, 03 十二月 2024 15:56:11 +0800 Subject: [PATCH] Merge remote-tracking branch 'origin/master' --- iailab-module-infra/iailab-module-infra-biz/src/main/java/com/iailab/module/infra/job/logger/AccessLogCleanJob.java | 80 ++++++++++++++++++++-------------------- 1 files changed, 40 insertions(+), 40 deletions(-) diff --git a/iailab-module-infra/iailab-module-infra-biz/src/main/java/com/iailab/module/infra/job/logger/AccessLogCleanJob.java b/iailab-module-infra/iailab-module-infra-biz/src/main/java/com/iailab/module/infra/job/logger/AccessLogCleanJob.java index fcd231f..d3cd136 100644 --- a/iailab-module-infra/iailab-module-infra-biz/src/main/java/com/iailab/module/infra/job/logger/AccessLogCleanJob.java +++ b/iailab-module-infra/iailab-module-infra-biz/src/main/java/com/iailab/module/infra/job/logger/AccessLogCleanJob.java @@ -1,40 +1,40 @@ -package com.iailab.module.infra.job.logger; - -import com.iailab.framework.tenant.core.aop.TenantIgnore; -import com.iailab.module.infra.service.logger.ApiAccessLogService; -import com.xxl.job.core.handler.annotation.XxlJob; -import lombok.extern.slf4j.Slf4j; -import org.springframework.stereotype.Component; - -import javax.annotation.Resource; - -/** - * 物理删除 N 天前的访问日志的 Job - * - * @author j-sentinel - */ -@Component -@Slf4j -public class AccessLogCleanJob { - - @Resource - private ApiAccessLogService apiAccessLogService; - - /** - * 清理超过(14)天的日志 - */ - private static final Integer JOB_CLEAN_RETAIN_DAY = 14; - - /** - * 每次删除间隔的条数,如果值太高可能会造成数据库的压力过大 - */ - private static final Integer DELETE_LIMIT = 100; - - @XxlJob("accessLogCleanJob") - @TenantIgnore - public void execute() { - Integer count = apiAccessLogService.cleanAccessLog(JOB_CLEAN_RETAIN_DAY, DELETE_LIMIT); - log.info("[execute][定时执行清理访问日志数量 ({}) 个]", count); - } - -} +//package com.iailab.module.infra.job.logger; +// +//import com.iailab.framework.tenant.core.aop.TenantIgnore; +//import com.iailab.module.infra.service.logger.ApiAccessLogService; +//import com.xxl.job.core.handler.annotation.XxlJob; +//import lombok.extern.slf4j.Slf4j; +//import org.springframework.stereotype.Component; +// +//import javax.annotation.Resource; +// +///** +// * 物理删除 N 天前的访问日志的 Job +// * +// * @author j-sentinel +// */ +//@Component +//@Slf4j +//public class AccessLogCleanJob { +// +// @Resource +// private ApiAccessLogService apiAccessLogService; +// +// /** +// * 清理超过(14)天的日志 +// */ +// private static final Integer JOB_CLEAN_RETAIN_DAY = 14; +// +// /** +// * 每次删除间隔的条数,如果值太高可能会造成数据库的压力过大 +// */ +// private static final Integer DELETE_LIMIT = 100; +// +// @XxlJob("accessLogCleanJob") +// @TenantIgnore +// public void execute() { +// Integer count = apiAccessLogService.cleanAccessLog(JOB_CLEAN_RETAIN_DAY, DELETE_LIMIT); +// log.info("[execute][定时执行清理访问日志数量 ({}) 个]", count); +// } +// +//} -- Gitblit v1.9.3