提交代码实现v1.0
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
package com.labelsys.backend.scheduled;
|
||||
|
||||
import com.labelsys.backend.service.AnnotationResultArchiveService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.scheduling.annotation.Scheduled;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@Slf4j
|
||||
@Component
|
||||
@RequiredArgsConstructor
|
||||
public class AutoArchiveAnnotationResultJob {
|
||||
|
||||
private final AnnotationResultArchiveService annotationResultArchiveService;
|
||||
|
||||
@Scheduled(fixedDelayString = "${labelsys.annotation.auto-archive-fixed-delay:300000}")
|
||||
public void autoArchiveEligibleResults() {
|
||||
int archivedCount = annotationResultArchiveService.autoArchiveEligibleResults();
|
||||
if (archivedCount > 0) {
|
||||
log.info("auto archived annotation results, count={}", archivedCount);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user