测试代码
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import javax.annotation.PostConstruct;
import java.time.Instant;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.TimeUnit;
/**
* @Description
* @Author aqin1012 AQin.
* @Date 2022/3/10 3:28 PM
* @Version 1.0
*/
@Service
public class RasService {
@Autowired
private ScheduledExecutorService scheduledExecutorService;
@PostConstruct
public void dbBackupTimer() {
System.out.println("START--->");
scheduledExecutorService.scheduleAtFixedRate(() -> {
System.out.println("哈哈哈哈~我就是个TEST "+Instant.now().toEp