From 88927397c7cf3fc93069805793d76d8f3aa999fb Mon Sep 17 00:00:00 2001 From: 23tae Date: Sat, 7 Dec 2024 12:57:38 +0900 Subject: [PATCH 1/2] =?UTF-8?q?feat:=20=EC=BA=90=EC=8B=9C=20=EC=9B=9C?= =?UTF-8?q?=EC=97=85=EC=8B=9C=20=EB=AF=B8=ED=8C=85=20=EC=B0=B8=EC=97=AC=20?= =?UTF-8?q?=EB=82=B4=EC=97=AD=EB=8F=84=20=ED=95=A8=EA=BB=98=20=EC=BA=90?= =?UTF-8?q?=EC=8B=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../admin/service/AdminService.kt | 42 +++++++++++++++---- 1 file changed, 35 insertions(+), 7 deletions(-) diff --git a/src/main/kotlin/uoslife/servermeeting/admin/service/AdminService.kt b/src/main/kotlin/uoslife/servermeeting/admin/service/AdminService.kt index 331a41b6..7712eb51 100644 --- a/src/main/kotlin/uoslife/servermeeting/admin/service/AdminService.kt +++ b/src/main/kotlin/uoslife/servermeeting/admin/service/AdminService.kt @@ -12,6 +12,7 @@ import uoslife.servermeeting.match.service.MatchingService import uoslife.servermeeting.meetingteam.dao.UserTeamDao import uoslife.servermeeting.payment.dto.response.PaymentResponseDto import uoslife.servermeeting.payment.service.PaymentService +import uoslife.servermeeting.user.repository.UserRepository import uoslife.servermeeting.user.service.UserService import uoslife.servermeeting.verification.util.VerificationConstants import uoslife.servermeeting.verification.util.VerificationUtils @@ -23,6 +24,7 @@ class AdminService( @Qualifier("PortOneService") private val paymentService: PaymentService, private val matchingService: MatchingService, private val userTeamDao: UserTeamDao, + private val userRepository: UserRepository, ) { companion object { private val logger = LoggerFactory.getLogger(AdminService::class.java) @@ -54,14 +56,40 @@ class AdminService( @Async fun warmUpCacheAsync(season: Int) { logger.info("[캐시 웜업 시작]") - val participants = userTeamDao.findAllParticipantsBySeasonAndType(season) - participants.forEach { participant -> - try { - matchingService.getMatchInfo(participant.userId, participant.teamType, season) - } catch (e: Exception) { - logger.info("[캐시 웜업 실패] userId: ${participant.userId} message: ${e.message}") + + try { + logger.info("[미팅 참여 정보 캐시 웜업 시작]") + val allUsers = userRepository.findAll() + allUsers.forEach { user -> + user.id?.let { userId -> + try { + matchingService.getUserMeetingParticipation(userId, season) + } catch (e: Exception) { + logger.info("[미팅 참여 정보 캐시 웜업 실패] userId: $userId message: ${e.message}") + } + } + } + logger.info("[미팅 참여 정보 캐시 웜업 완료] 대상 인원: ${allUsers.size}") + } catch (e: Exception) { + logger.error("[미팅 참여 정보 캐시 웜업 전체 실패] message: ${e.message}") + } + + try { + logger.info("[매칭 결과 캐시 웜업 시작]") + val participants = userTeamDao.findAllParticipantsBySeasonAndType(season) + participants.forEach { participant -> + try { + matchingService.getMatchInfo(participant.userId, participant.teamType, season) + } catch (e: Exception) { + logger.info( + "[매칭 결과 캐시 웜업 실패] userId: ${participant.userId} message: ${e.message}" + ) + } } + logger.info("[매칭 결과 캐시 웜업 완료] 대상 인원: ${participants.size}") + } catch (e: Exception) { + logger.error("[매칭 결과 캐시 웜업 전체 실패] message: ${e.message}") } - logger.info("[캐시 웜업 성공] 대상 인원: ${participants.size}") + logger.info("[캐시 웜업 완료]") } } From 5cfbc253d3d802f53486ce8b589e51f8db2b7f50 Mon Sep 17 00:00:00 2001 From: 23tae Date: Sat, 7 Dec 2024 12:58:42 +0900 Subject: [PATCH 2/2] =?UTF-8?q?fix:=20=EB=A7=A4=EC=B9=AD=20=EA=B2=B0?= =?UTF-8?q?=EA=B3=BC=20=EC=BA=90=EC=8B=9C=20=EC=9B=9C=EC=97=85=20=EC=8B=9C?= =?UTF-8?q?=20=EA=B2=B0=EC=A0=9C=20=EC=A1=B0=EA=B1=B4=20=EA=B2=80=EC=A6=9D?= =?UTF-8?q?=20=EB=A1=9C=EC=A7=81=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../uoslife/servermeeting/meetingteam/dao/UserTeamDao.kt | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main/kotlin/uoslife/servermeeting/meetingteam/dao/UserTeamDao.kt b/src/main/kotlin/uoslife/servermeeting/meetingteam/dao/UserTeamDao.kt index 4333e644..e09b0d7c 100644 --- a/src/main/kotlin/uoslife/servermeeting/meetingteam/dao/UserTeamDao.kt +++ b/src/main/kotlin/uoslife/servermeeting/meetingteam/dao/UserTeamDao.kt @@ -124,13 +124,14 @@ class UserTeamDao( ) .from(userTeam) .join(userTeam.team, meetingTeam) - .leftJoin(payment) + .join(payment) .on(payment.meetingTeam.eq(meetingTeam)) .where( meetingTeam.season.eq(season), + payment.meetingTeam.type.eq(userTeam.team.type), + payment.status.eq(PaymentStatus.SUCCESS) ) .groupBy(userTeam.user.id, userTeam.team.type) - .having(payment.status.eq(PaymentStatus.SUCCESS).count().eq(payment.count())) .fetch() } }