songhuangfeng123
2022-09-08 bfb4c1e1d4e3f99f74a51ef5b67531f9d91d0dde
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
package com.gkhy.safePlatform.targetDuty.schedule;
 
import com.gkhy.safePlatform.targetDuty.service.TargetTypeService;
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("goalKeepAlive")
@EnableScheduling
@ConditionalOnProperty(prefix = "threadPool.scheduling", name = "enabled", havingValue = "true")
public class KeepAliveRobot {
 
    @Autowired
    private TargetTypeService targetTypeService;
 
    // 30m
    @Scheduled(cron = "0 0/30 * * * ?")
    public void keepAlive(){
        //
//        targetTypeService.getById(-1L);
 
    }
 
}