Back-End/Spring
[Spring] Spring Scheduler의 기본 설정은 싱글 스레드이다.
[Spring] Spring Scheduler의 기본 설정은 싱글 스레드이다.
2023.11.28원래 스프링 부트가 제공해주는 스케줄러를 쓰고 있었는데, 다른 task를 추가해야 할 일이 생겼다. 그런데 이 스케줄링이 겹치면 어떻게 될 지 궁금해졌다. Scheduler 테스트 셋팅 먼저 Configuration이 선언된 곳에서 @EnableScheduling을 추가해준다. @SpringBootApplication @EnableScheduling public class PlaygroundApplication { public static void main(String[] args) { SpringApplication.run(PlaygroundApplication.class, args); } } 두개의 스케줄러를 등록한다. test1: 1초마다 수행, 5초의 작업 시간이 걸린다. test2: 1초마다 수..