Browse Source

fix 自动清理日志定时器

master
周俊杰 7 months ago
parent
commit
42296ed5e7
  1. 2
      hd/nladmin-system/src/main/java/org/nl/modules/quartz/task/AutoCleanLog.java

2
hd/nladmin-system/src/main/java/org/nl/modules/quartz/task/AutoCleanLog.java

@ -23,8 +23,10 @@ public class AutoCleanLog {
//sys_log //sys_log
//delete from sys_log where DATE(create_time) <= DATE(DATE_SUB(NOW(),INTERVAL 30 day)) limit 10; //delete from sys_log where DATE(create_time) <= DATE(DATE_SUB(NOW(),INTERVAL 30 day)) limit 10;
WQLObject logTab = WQLObject.getWQLObject("sys_log"); WQLObject logTab = WQLObject.getWQLObject("sys_log");
WQLObject logTab1 = WQLObject.getWQLObject("acs_log");
int days = Integer.parseInt(acsConfigService.findConfigFromCache().get(AcsConfig.AutoCleanDays)); int days = Integer.parseInt(acsConfigService.findConfigFromCache().get(AcsConfig.AutoCleanDays));
logTab.delete("DATE(create_time) <= DATE(DATE_SUB(NOW(),INTERVAL " + days + " day)) limit 50"); logTab.delete("DATE(create_time) <= DATE(DATE_SUB(NOW(),INTERVAL " + days + " day)) limit 50");
logTab1.delete("DATE(create_time) <= DATE(DATE_SUB(NOW(),INTERVAL " + days + " day)) limit 50");
log.info("自动清理日志执行成功...!"); log.info("自动清理日志执行成功...!");
} }

Loading…
Cancel
Save