refactor(monitor): 表数据清理交给运维同事统一处理
This commit is contained in:
@@ -1,33 +0,0 @@
|
||||
package com.lanyuanxiaoyao.service.monitor.clean;
|
||||
|
||||
import com.lanyuanxiaoyao.service.forest.service.InfoService;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.scheduling.annotation.Scheduled;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import static com.lanyuanxiaoyao.service.common.Constants.MINUTE;
|
||||
|
||||
/**
|
||||
* 清理compaction metrics表
|
||||
*
|
||||
* @author lanyuanxiaoyao
|
||||
* @date 2024-05-23
|
||||
*/
|
||||
@SuppressWarnings("SpringJavaInjectionPointsAutowiringInspection")
|
||||
@Service
|
||||
public class CompactionMetricsCleaner extends Cleaner {
|
||||
private static final Logger logger = LoggerFactory.getLogger(CompactionMetricsCleaner.class);
|
||||
|
||||
private final InfoService infoService;
|
||||
|
||||
public CompactionMetricsCleaner(InfoService infoService) {
|
||||
this.infoService = infoService;
|
||||
}
|
||||
|
||||
@Scheduled(cron = "0 0 6 * * ?")
|
||||
@Override
|
||||
void clean() {
|
||||
logger.info("Clean compaction metrics: {}", infoService.cleanCompactionMetrics());
|
||||
}
|
||||
}
|
||||
@@ -1,31 +0,0 @@
|
||||
package com.lanyuanxiaoyao.service.monitor.clean;
|
||||
|
||||
import com.lanyuanxiaoyao.service.forest.service.InfoService;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.scheduling.annotation.Scheduled;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* 清理table version表
|
||||
*
|
||||
* @author lanyuanxiaoyao
|
||||
* @date 2024-05-23
|
||||
*/
|
||||
@SuppressWarnings("SpringJavaInjectionPointsAutowiringInspection")
|
||||
@Service
|
||||
public class TableVersionCleaner extends Cleaner {
|
||||
private static final Logger logger = LoggerFactory.getLogger(TableVersionCleaner.class);
|
||||
|
||||
private final InfoService infoService;
|
||||
|
||||
public TableVersionCleaner(InfoService infoService) {
|
||||
this.infoService = infoService;
|
||||
}
|
||||
|
||||
@Scheduled(cron = "0 0 7 * * ?")
|
||||
@Override
|
||||
void clean() {
|
||||
logger.info("Clean table version: {}", infoService.cleanTableVersion());
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user