Monica视频监控处理程序
xc
2021-02-08 05760dc061cc472bfb28c96f5dcc188456620330
src/main/java/com/hbbh/adapter/schedule/Task.java
@@ -1,26 +1,15 @@
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
//@Configuration
//@EnableScheduling
public class Task {
    @Autowired
    DataSource dataSource;
    /**
     * 间隔5秒 执行一次
     */
    //@Scheduled(cron = "0/5 * * * * ?")
    @Scheduled(fixedRate=10000)
    //@Scheduled(fixedRate=30000)
    private void task01() throws Exception {
        dataSource.execute();
        //dataSource.execute();
    }
}