File tree Expand file tree Collapse file tree
src/main/java/io/wisoft/prepair/prepair_api/scheduler Expand file tree Collapse file tree Original file line number Diff line number Diff line change 77import org .springframework .scheduling .annotation .Scheduled ;
88import org .springframework .stereotype .Component ;
99
10- import java .time .LocalDateTime ;
1110import java .util .UUID ;
1211
1312@ Slf4j
@@ -19,13 +18,18 @@ public class TodayQuestionScheduler {
1918
2019 @ Scheduled (cron = "0 0 9 * * *" , zone = "Asia/Seoul" )
2120 public void generateTodayQuestions () {
22- String correlationId = "SCHEDULER-" + UUID .randomUUID (). toString () ;
21+ String correlationId = "SCHEDULER-" + UUID .randomUUID ();
2322 MDC .put ("correlationId" , correlationId );
23+ long startTime = System .currentTimeMillis ();
24+
2425 try {
25- log .info ("오늘의 질문 생성 스케줄러 시작 - {}" , LocalDateTime . now () );
26+ log .info ("오늘의 질문 생성 스케줄러 시작" );
2627 todayQuestionService .sendTodayQuestions ();
27- log .info ("오늘의 질문 생성 스케줄러 종료" );
28- } finally {
28+ log .info ("오늘의 질문 생성 스케줄러 종료 | elapsed={}ms" , System .currentTimeMillis () - startTime );
29+ } catch (Exception e ) {
30+ log .error ("오늘의 질문 생성 스케줄러 실패 | elapsed={}ms" , System .currentTimeMillis () - startTime , e );
31+ }
32+ finally {
2933 MDC .remove ("correlationId" );
3034 }
3135 }
You can’t perform that action at this time.
0 commit comments