generated from GSM-MSG/MSG-Repository-Generator
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #120 from GSM-MSG/119-feat/data-init-count
#119 DataInitializer 데이터 존재 여부 count 쿼리 성능 개선
- Loading branch information
Showing
8 changed files
with
57 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 5 additions & 0 deletions
5
bitgouel-domain/src/main/kotlin/team/msg/domain/club/repository/CustomClubRepository.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
package team.msg.domain.club.repository | ||
|
||
interface CustomClubRepository { | ||
fun existsOne(id: Long): Boolean | ||
} |
18 changes: 18 additions & 0 deletions
18
bitgouel-domain/src/main/kotlin/team/msg/domain/club/repository/CustomClubRepositoryImpl.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package team.msg.domain.club.repository | ||
|
||
import com.querydsl.jpa.impl.JPAQueryFactory | ||
import team.msg.domain.club.model.QClub.club | ||
|
||
class CustomClubRepositoryImpl( | ||
private val queryFactory: JPAQueryFactory | ||
) : CustomClubRepository { | ||
|
||
override fun existsOne(id: Long): Boolean { | ||
val fetchOne = queryFactory.selectOne() | ||
.from(club) | ||
.where(club.id.eq(id)) | ||
.fetchFirst() // limit 1 | ||
|
||
return fetchOne != null | ||
} | ||
} |
5 changes: 5 additions & 0 deletions
5
bitgouel-domain/src/main/kotlin/team/msg/domain/school/repository/CustomSchoolRepository.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
package team.msg.domain.school.repository | ||
|
||
interface CustomSchoolRepository { | ||
fun existsOne(id: Long): Boolean | ||
} |
18 changes: 18 additions & 0 deletions
18
...el-domain/src/main/kotlin/team/msg/domain/school/repository/CustomSchoolRepositoryImpl.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package team.msg.domain.school.repository | ||
|
||
import com.querydsl.jpa.impl.JPAQueryFactory | ||
import team.msg.domain.school.model.QSchool.school | ||
|
||
class CustomSchoolRepositoryImpl( | ||
private val queryFactory: JPAQueryFactory | ||
) : CustomSchoolRepository { | ||
|
||
override fun existsOne(id: Long): Boolean { | ||
val fetchOne = queryFactory.selectOne() | ||
.from(school) | ||
.where(school.id.eq(id)) | ||
.fetchFirst() // limit 1 | ||
|
||
return fetchOne != null | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,24 @@ | ||
#!/bin/bash | ||
BUILD_JAR=$(ls /home/ec2-user/Bitgouel-Server/bitgouel-api/build/libs/*.jar) | ||
JAR_NAME=$(basename $BUILD_JAR) | ||
echo "> build 파일명: $JAR_NAME" >> /home/ec2-user/action/deploy.log | ||
echo "> build 파일명: $JAR_NAME" >> /home/ec2-user/deploy.log | ||
|
||
echo "> build 파일 복사" >> /home/ec2-user/action/deploy.log | ||
DEPLOY_PATH=/home/ec2-user/action/ | ||
echo "> build 파일 복사" >> /home/ec2-user/deploy.log | ||
DEPLOY_PATH=/home/ec2-user/ | ||
cp $BUILD_JAR $DEPLOY_PATH | ||
|
||
echo "> 현재 실행중인 애플리케이션 pid 확인" >> /home/ec2-user/action/deploy.log | ||
echo "> 현재 실행중인 애플리케이션 pid 확인" >> /home/ec2-user/deploy.log | ||
CURRENT_PID=$(pgrep -f $JAR_NAME) | ||
|
||
if [ -z $CURRENT_PID ] | ||
then | ||
echo "> 현재 구동중인 애플리케이션이 없으므로 종료하지 않습니다." >> /home/ec2-user/action/deploy.log | ||
echo "> 현재 구동중인 애플리케이션이 없으므로 종료하지 않습니다." >> /home/ec2-user/deploy.log | ||
else | ||
echo "> kill -15 $CURRENT_PID" | ||
kill -15 $CURRENT_PID | ||
sleep 5 | ||
fi | ||
|
||
DEPLOY_JAR=$DEPLOY_PATH$JAR_NAME | ||
echo "> DEPLOY_JAR 배포" >> /home/ec2-user/action/deploy.log | ||
echo "> DEPLOY_JAR 배포" >> /home/ec2-user/deploy.log | ||
nohup java -jar $DEPLOY_JAR --logging.file.path=/home/ec2-user/ --logging.level.org.hibernate.SQL=DEBUG >> /home/ec2-user/deploy.log 2>/home/ec2-user/deploy_err.log & |