@@ -110,7 +110,7 @@ public void setConcertsList() throws InterruptedException {
110110 totalConcertsList .add (p );
111111 }
112112 log .info ("Total Concert List: {}" , totalConcertsList .size () + "개의 데이터 가져오는중..." );
113- Thread .sleep (200 );
113+ Thread .sleep (120 );
114114 }
115115
116116 }catch (Exception e ){
@@ -124,7 +124,9 @@ public void setConcertsList() throws InterruptedException {
124124 log .info ("공연 목록 로드 완료, 공연 세부 내용 로드 및 저장" );
125125 try {
126126 for (ConcertListElement performanceListElement : totalConcertsList ) {
127+ // API에서 공연 상세 가져오기
127128 ConcertDetailResponse concertDetailResponse = getConcertDetailResponse (serviceKey , performanceListElement .getApiConcertId ());
129+ Thread .sleep (120 );
128130 ConcertDetailElement concertDetail = concertDetailResponse .getConcertDetail ();
129131
130132 // 콘서트 위치 저장
@@ -135,6 +137,7 @@ public void setConcertsList() throws InterruptedException {
135137 if (concertPlace == null ) {
136138 // 맵이나 DB에 없다면 API에서 해당 콘서트 위치를 가져와서 DB에 저장 후 캐시에 저장
137139 ConcertPlaceDetailResponse concertPlaceDetailElement = getConcertPlaceDetailResponse (serviceKey , concertPlaceAPiKey );
140+ Thread .sleep (120 );
138141 ConcertPlaceDetailElement concertPlaceDetail = concertPlaceDetailElement .getConcertPlaceDetail ();
139142 concertPlace = concertPlaceDetail .getConcertPlace ();
140143 ConcertPlace savedConcertPlace = placeRepository .save (concertPlace );
@@ -165,8 +168,6 @@ public void setConcertsList() throws InterruptedException {
165168
166169 addedTicketOffices += saveConcertTicketOffice (concertDetail , savedConcert );
167170 addedConcertImages += saveConcertImages (concertDetail , savedConcert );
168-
169- Thread .sleep (300 );
170171 }
171172 } catch (Exception e ) {
172173 log .error ("개별 공연 세부 내용 저장 도중 오류 발생" );
@@ -284,6 +285,7 @@ public SetResultResponse updateConcertData() throws InterruptedException {
284285 // 기존에 저장되어 있던 연관 테이블 데이터 삭제
285286 ticketOfficeRepository .deleteByConcertId (savedConcert .getConcertId ());
286287 imageRepository .deleteByConcertId (savedConcert .getConcertId ());
288+ // 갱신된 데이터로 연관 테이블 저장
287289 updatedTicketOffices += saveConcertTicketOffice (concertDetail , savedConcert );
288290 updatedConcertImages += saveConcertImages (concertDetail , savedConcert );
289291 }
0 commit comments