tj
2025-06-05 2d549a04870d1315868a7cf19952b64e8071e711
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
33
package com.cloudroam.task;
 
import lombok.extern.slf4j.Slf4j;
import javax.annotation.PostConstruct;
import java.util.concurrent.Executors;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.TimeUnit;
 
/**
 * @author  taojie
 *
 * 1.根据数据库配置的邮箱地址来发送邮件
 * 2.根据数据库任务配置时间来发送邮件
 */
//@Component
@Slf4j
public class PmsTaskExecutors {
 
    private final static ScheduledExecutorService scheduler= Executors.newScheduledThreadPool(5);
 
    @PostConstruct
    public void init() {
        scheduler.scheduleAtFixedRate(() -> {
            try {
 
 
            } catch (Exception e) {
                e.printStackTrace();
            }
        }, 0, 1, TimeUnit.MINUTES); // 每隔一分钟检查一次数据库
    }
 
}