-
Notifications
You must be signed in to change notification settings - Fork 0
Fix/알림이 10분 뒤에 도착하는 문제 해결 #19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
The head ref may contain hidden characters: "fix/\uC54C\uB9BC\uC774-10\uBD84-\uB4A4\uC5D0-\uB3C4\uCC29\uD558\uB294-\uBB38\uC81C"
Merged
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
b717857
feat: UpcomingScheduleNotification의 scheduleStartTime 타입을 Instant로 변경
GoGradually bc04d7c
test: UpcomingScheduleNotification의 scheduleStartTime 타입을 Instant로 변경
GoGradually 804cd28
feat: UpcomingScheduleNotification의 scheduleStartTime 타입을 Instant로 변경
GoGradually 937eedb
feat: UpcomingScheduleNotification의 scheduleStartTime을 Instant로 변경 및 …
GoGradually bcf1152
feat: ScheduleGrpcClient에서 Timestamp를 ISO 문자열로 변환하는 로직 개선
GoGradually ed9306d
feat: NotificationDispatchQueryRepositoryAdapter에서 scheduleStartTime을…
GoGradually f6c6fc5
feat: UpcomingScheduleNotification의 scheduleStartTime 타입을 String에서 In…
GoGradually 06c6a70
feat: UpcomingScheduleNotificationRepositoryAdapter에서 scheduleStartTi…
GoGradually 96a09bc
feat: ScheduleStartTimeFormatter 클래스 추가 및 시간 포맷팅 기능 구현
GoGradually 713001c
feat: Hibernate JDBC 시간대 설정을 UTC로 변경
GoGradually File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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
41 changes: 41 additions & 0 deletions
41
src/main/java/me/pinitnotification/domain/shared/ScheduleStartTimeFormatter.java
This file contains hidden or 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,41 @@ | ||
| package me.pinitnotification.domain.shared; | ||
|
|
||
| import java.time.Instant; | ||
| import java.time.OffsetDateTime; | ||
| import java.time.ZoneOffset; | ||
| import java.time.format.DateTimeFormatter; | ||
| import java.time.format.DateTimeParseException; | ||
| import java.time.temporal.ChronoUnit; | ||
|
|
||
| public final class ScheduleStartTimeFormatter { | ||
| private static final DateTimeFormatter UTC_SECONDS_FORMATTER = DateTimeFormatter | ||
| .ofPattern("yyyy-MM-dd'T'HH:mm:ss'Z'") | ||
| .withZone(ZoneOffset.UTC); | ||
|
|
||
| private ScheduleStartTimeFormatter() { | ||
| } | ||
|
|
||
| public static String format(Instant instant) { | ||
| return UTC_SECONDS_FORMATTER.format(instant.truncatedTo(ChronoUnit.SECONDS)); | ||
| } | ||
|
|
||
| public static String format(OffsetDateTime offsetDateTime) { | ||
| return format(offsetDateTime.toInstant()); | ||
| } | ||
|
|
||
| public static String normalize(String rawScheduleStartTime) { | ||
| return format(parse(rawScheduleStartTime)); | ||
| } | ||
|
|
||
| public static Instant parse(String rawScheduleStartTime) { | ||
| if (rawScheduleStartTime == null || rawScheduleStartTime.isBlank()) { | ||
| throw new IllegalArgumentException("scheduleStartTime must not be null or blank"); | ||
| } | ||
|
|
||
| try { | ||
| return OffsetDateTime.parse(rawScheduleStartTime).toInstant(); | ||
| } catch (DateTimeParseException ignored) { | ||
| return Instant.parse(rawScheduleStartTime); | ||
| } | ||
| } | ||
| } |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(1) 문제점:
schedule_start_time컬럼 매핑이String→Instant로 변경되어 JPA가 DB 컬럼을 TIMESTAMP/DATETIME 계열로 기대하게 됩니다. 현재 prod 설정이ddl-auto: validate라서 운영 DB 스키마가 즉시 반영되지 않으면 애플리케이션이 기동 단계에서 스키마 검증 실패로 내려갈 수 있습니다.(2) 영향: 운영 배포 시 서비스 기동 불가(또는 dev에서는 자동 스키마 변경으로 데이터/인덱스 변환이 발생) 가능성이 있으며, 기존 VARCHAR 데이터가 있다면 변환 과정에서 파싱 실패/값 손실 위험이 있습니다.
(3) 수정 제안: 이 변경과 함께 명시적인 DB 마이그레이션(예:
ALTER TABLE ... MODIFY schedule_start_time TIMESTAMP(6) ...+ 기존 문자열 데이터를 UTC TIMESTAMP로 변환)과 배포 순서(선-스키마, 후-애플리케이션)를 PR에 포함하거나, 최소한 운영 반영 절차를 문서/릴리즈 노트로 남겨주세요.