优化任务删除方法,核心代码注释
This commit is contained in:
@@ -6,13 +6,28 @@ import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.scheduling.annotation.Scheduled;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
/**
|
||||
* 标注结果自动归档定时任务
|
||||
* <p>
|
||||
* 定期检查并归档符合条件的标注结果,
|
||||
* 将已完成且超过自动归档超时时间的结果归档到历史表。
|
||||
*/
|
||||
@Slf4j
|
||||
@Component
|
||||
@RequiredArgsConstructor
|
||||
public class AutoArchiveAnnotationResultJob {
|
||||
|
||||
/**
|
||||
* 标注结果归档服务
|
||||
*/
|
||||
private final AnnotationResultArchiveService annotationResultArchiveService;
|
||||
|
||||
/**
|
||||
* 自动归档符合条件的标注结果
|
||||
* <p>
|
||||
* 定时执行,默认每5分钟执行一次,可通过配置调整执行间隔。
|
||||
* 归档完成后记录日志。
|
||||
*/
|
||||
@Scheduled(fixedDelayString = "${labelsys.annotation.auto-archive-fixed-delay:300000}")
|
||||
public void autoArchiveEligibleResults() {
|
||||
int archivedCount = annotationResultArchiveService.autoArchiveEligibleResults();
|
||||
@@ -20,4 +35,4 @@ public class AutoArchiveAnnotationResultJob {
|
||||
log.info("auto archived annotation results, count={}", archivedCount);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user