This commit is contained in:
张良(004796)
2024-01-22 10:23:59 +08:00
parent caa4e22800
commit a30b615fc3
10 changed files with 104 additions and 3 deletions

View File

@@ -0,0 +1,33 @@
package com.ruoyi.cai.job;
import com.ruoyi.cai.service.DynamicService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
@Component
@Slf4j
public class ClearJob {
@Autowired
private DynamicService dynamicService;
@Scheduled(cron = "0 1 0 * * ? ")
public void persistentDb() {
try {
log.info("定时删除动态== 开始");
dynamicService.clearDynamic(12);
log.info("定时删除动态== 结束");
}catch (Exception e){
log.error("定时删除动态== 异常",e);
}
try {
}catch (Exception e){
}
}
}