package com.gkhy.safePlatform.incidentManage.schedule;
|
|
import com.gkhy.safePlatform.incidentManage.service.baseService.AccidentCaseInfoService;
|
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
import org.springframework.scheduling.annotation.EnableScheduling;
|
import org.springframework.scheduling.annotation.Scheduled;
|
import org.springframework.stereotype.Component;
|
|
|
@Component("incidentKeepAlive")
|
@EnableScheduling
|
@ConditionalOnProperty(prefix = "threadPool.scheduling", name = "enabled", havingValue = "true")
|
public class KeepAliveRobot {
|
|
@Autowired
|
private AccidentCaseInfoService accidentCaseInfoService;
|
|
// 30m
|
@Scheduled(cron = "0 0/30 * * * ?")
|
public void keepAlive(){
|
//
|
accidentCaseInfoService.getById(-1L);
|
|
}
|
|
}
|