package cn.com.qmth.stmms.admin.quartz;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

import cn.com.qmth.stmms.biz.mark.service.TaskService;
import cn.com.qmth.stmms.biz.mark.service.Impl.TaskServiceImpl;

@Component
public class ScheduleRunner {

    @Value("${jvm.cleanMapinterval}")
    private long cleanMapinterval;

    @Scheduled(cron = "${jvm.cleanMapTimer}")
    public void schClearTaskMap() {
        TaskService taskServiceImpl = new TaskServiceImpl();
        try {
            taskServiceImpl.clearTaskMap(cleanMapinterval);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
