package cn.yunzhixue.ability.center.examsprint.application.report;

import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

@Component
public class ExamSprintReportRetentionScheduler {

    private final DefaultExamSprintReportApplicationService applicationService;

    public ExamSprintReportRetentionScheduler(DefaultExamSprintReportApplicationService applicationService) {
        this.applicationService = applicationService;
    }

    @Scheduled(fixedDelayString = "${ability.exam-sprint.report.cleanup-interval-ms:600000}")
    public void cleanupExpiredReports() {
        applicationService.cleanupExpiredReports();
    }
}
