package org.dromara.web.task;

import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.dromara.web.service.LearnerIdleSessionService;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

@Slf4j
@Component
@RequiredArgsConstructor
public class LearnerIdleSessionScanTask {

    private final LearnerIdleSessionService learnerIdleSessionService;

    @Scheduled(cron = "0/30 * * * * ?")
    public void scanIdleTimeout() {
        learnerIdleSessionService.scanAndKickTimeout();
    }
}
