Skip to content

Commit 74213e5

Browse files
committed
update :: data initializer count 성능 개선 적용
1 parent 5e23eb7 commit 74213e5

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

bitgouel-api/src/main/kotlin/team/msg/common/init/DataInitializer.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,17 +41,17 @@ class DataInitializer(
4141

4242
/**
4343
* ApplicationReadyEvent가 발행되면 initData가 실행됩니다.
44-
* school, club의 데이터 count가 0이라면 데이터 삽입이 실행됩니다.
44+
* school, club id = 1인 엔티티가 존재하면 Data Init을 실행하지 않는다.
4545
*/
4646
@EventListener(ApplicationReadyEvent::class)
4747
@Transactional
4848
fun initData() {
49-
if(schoolRepository.count() == 0L) {
49+
if(schoolRepository.existsOne(1)) {
5050
log.info("=== RUN Init School Data ===")
5151
initSchool()
5252
}
5353

54-
if(clubRepository.count() == 0L) {
54+
if(clubRepository.existsOne(1)) {
5555
log.info("=== RUN Init Club Data ===")
5656
initClub()
5757
}

0 commit comments

Comments
 (0)