Monica视频监控处理程序
xc
2020-12-07 16806eadf0dff9123ec09ea708078f223d155d7c
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
package com.hbbh.adapter.schedule;
 
import com.hbbh.adapter.manager.DataSource;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled;
 
import java.time.LocalDateTime;
 
@Configuration
@EnableScheduling
public class Task {
 
    @Autowired
    DataSource dataSource;
 
    /**
     * 间隔5秒 执行一次
     */
    //@Scheduled(cron = "0/5 * * * * ?")
    @Scheduled(fixedRate=30000)
    private void task01() throws Exception {
        dataSource.execute();
    }
}