scheduled1 스프링 스케줄러 중복 작동 주기적으로 데이터 업데이트가 필요한 작업이 있어 스케줄러 컨트롤러를 따로 뽑아내고 작업을 하는 중 문제가 발생했다. @Component @EnableScheduling public class ScheduledApplication { private static int count = 0; //실행 1초뒤 @Scheduled(fixedDelay = 1000) public void testScheduledTask() throws Exception { System.out.print("스케줄러 실행! "+ count++); System.out.println(" "+(System.currentTimeMillis()/1000)); } } 1초마다 실행되어야 할 스케줄러이지만 콘솔창은 다음과 같이 출력되었다. ... 스.. 2023. 3. 21. 이전 1 다음 반응형