From f3e89c4e2c33da6d6b878b6ee2bcc79d3a7f6966 Mon Sep 17 00:00:00 2001 From: ikjunoh Date: Sun, 25 Aug 2024 14:58:26 +0900 Subject: [PATCH] =?UTF-8?q?fix=20:=20=EC=88=A8=EC=9D=80=EC=BA=90=EC=8A=A4?= =?UTF-8?q?=ED=8D=BC=EC=B0=BE=EA=B8=B0=20=EA=B2=8C=EC=9E=84=20=EB=A7=88?= =?UTF-8?q?=EC=A7=80=EB=A7=89=EB=82=A0=20=EC=9D=BC=20=EB=95=8C=20=EC=9D=B8?= =?UTF-8?q?=EB=8D=B1=EC=8A=A4=20=EC=97=90=EB=9F=AC=20=ED=95=B4=EA=B2=B0=20?= =?UTF-8?q?(hotfix-1)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../findinggame/service/FindingGameService.java | 11 ++++++----- src/main/resources/application-dev.yml | 6 +++++- src/main/resources/application-prod.yml | 6 ++++++ src/main/resources/application.yml | 8 +------- 4 files changed, 18 insertions(+), 13 deletions(-) diff --git a/src/main/java/ai/softeer/caecae/findinggame/service/FindingGameService.java b/src/main/java/ai/softeer/caecae/findinggame/service/FindingGameService.java index a4c91d0..e0ed524 100644 --- a/src/main/java/ai/softeer/caecae/findinggame/service/FindingGameService.java +++ b/src/main/java/ai/softeer/caecae/findinggame/service/FindingGameService.java @@ -76,12 +76,13 @@ public StartGameResponseDto startFindingGame() { HashMap infoHashMap = new HashMap<>(); - //TODO: nextGameIndex == -1 이면 에러 수정 - FindingGameDailyInfo nextGameInfo = dto.findingGameInfos().get(nextGameIndex); LocalDateTime nowTime = LocalDateTime.now(clock); - // 캐싱으로 인해 다음 게임이 이미 시작된 경우를 확인 - if (nextGameInfo.startTime().isBefore(nowTime) && nextGameInfo.endTime().isBefore(nowTime)) { - recentGameIndex = nextGameIndex; + if (nextGameIndex != -1) { + FindingGameDailyInfo nextGameInfo = dto.findingGameInfos().get(nextGameIndex); + // 캐싱으로 인해 다음 게임이 이미 시작된 경우를 확인 + if (nextGameInfo.startTime().isBefore(nowTime) && nextGameInfo.endTime().isBefore(nowTime)) { + recentGameIndex = nextGameIndex; + } } FindingGameDailyInfo gameInfo = dto.findingGameInfos().get(recentGameIndex); diff --git a/src/main/resources/application-dev.yml b/src/main/resources/application-dev.yml index 4287ca8..0d66f21 100644 --- a/src/main/resources/application-dev.yml +++ b/src/main/resources/application-dev.yml @@ -1 +1,5 @@ -# \ No newline at end of file +spring: + jpa: + properties: + hibernate: + show_sql: true \ No newline at end of file diff --git a/src/main/resources/application-prod.yml b/src/main/resources/application-prod.yml index 6ac7515..eba2179 100644 --- a/src/main/resources/application-prod.yml +++ b/src/main/resources/application-prod.yml @@ -15,3 +15,9 @@ spring: bucket: ${S3_BUCKET} region: static: ${REGION} + +management: + endpoints: + web: + exposure: + include: "prometheus" diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml index 5a93cf4..85b67d1 100644 --- a/src/main/resources/application.yml +++ b/src/main/resources/application.yml @@ -10,7 +10,7 @@ spring: ddl-auto: update properties: hibernate: - show_sql: true + show_sql: false format_sql: true highlight_sql: true database-platform: org.hibernate.dialect.MySQLDialect @@ -38,12 +38,6 @@ logging: pattern: dateformat: yyyy-MM-dd HH:mm:ss.SSSz,Asia/Seoul # 로그 시간 설정 -management: - endpoints: - web: - exposure: - include: "prometheus" - images: preview: ${PREVIEW_IMAGE}