whycxzp
2024-08-01 8814d819464c862dbf6657fd01fea3dcd1422dd7
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
28
29
30
31
32
//package com.whyc.schedule;
//
//import com.whyc.factory.ThreadPoolExecutorFactory;
//import com.whyc.service.SNMPConnectService;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.scheduling.annotation.EnableScheduling;
//import org.springframework.scheduling.annotation.Scheduled;
//import org.springframework.stereotype.Component;
//
//@EnableScheduling
//@Component
//public class SNMPScheduleService {
//
//    @Autowired
//    private SNMPConnectService service;
//
//    /**数据4秒钟获取一次*/
//    @Scheduled(cron = "0/4 * * * * ? ")
//    public void getAndSaveB247(){
//        ThreadPoolExecutorFactory.getPoolExecutor().execute(()->{
//            service.getAndSaveB247();
//        });
//    }
//
//    @Scheduled(cron = "0/4 * * * * ? ")
//    public void getAndSaveA250(){
//        ThreadPoolExecutorFactory.getPoolExecutor().execute(()->{
//            service.getAndSaveA250();
//        });
//    }
//
//}