[Spring/Kotlin] 스케줄 설정 하기 - Schedule / Cron
Kotlin 기반 Spring 에서 스케줄 설정 하는 법을 알아봅시다. 먼저 메인 클래스에 스케줄을 활성화 합니다. @EnableWebMvc @EnableScheduling // 여기 선언 @SpringBootApplication( exclude= [ DataSourceAutoConfiguration::class, DataSourceTransactionManagerAutoConfiguration::class ]) class ServerApplication 그리고 사용할 메서드 위에 아래와 같이 선언한다. @Scheduled(cron = "0 * * * * *") @RequestMapping(value = ["/SendMatchStart"], method = [RequestMethod.POST]) fun ..
프로그래밍/Kotlin
2023. 3. 7. 12:56