-
Notifications
You must be signed in to change notification settings - Fork 1
prod #390
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
prod #390
Conversation
refactor: 1026 수험 번호 배치 시간 수정
Summary of ChangesHello @chominju02, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request adjusts the scheduled execution time for the Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the ✨ Finishing touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
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.
Code Review
안녕하세요. PR을 리뷰했습니다. 이번 변경은 ExamNumberGenerationJobRound2의 크론 실행 시간을 수정하는 내용입니다. 코드 리뷰에서는 하드코딩된 값들과 코드 중복으로 인해 발생할 수 있는 장기적인 유지보수성 문제에 대해 의견을 남겼습니다. 각 시험 일정마다 새로운 잡 클래스를 생성하는 현재 구조 대신, 설정을 통해 동적으로 잡을 관리하는 일반화된 구조로 리팩토링하는 것을 제안합니다. 이렇게 하면 시스템의 유연성과 안정성을 크게 향상시킬 수 있습니다. 자세한 내용은 개별 코멘트를 확인해주세요.
|
|
||
| @Slf4j | ||
| @CronJob(cron = "0 0 6 20 10 ?", name = "examNumberGeneratorJob_20251026") | ||
| @CronJob(cron = "0 0 3 22 10 ?", name = "examNumberGeneratorJob_20251026") |
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.
이 PR은 크론 실행 시간만 변경하고 있지만, 현재 잡(Job) 구현 방식은 장기적인 유지보수성에 문제가 될 수 있습니다.
@CronJob 애노테이션의 cron 표현식, name, 그리고 execute 메소드 내부의 examDate (LocalDate.of(2025, 10, 26))가 모두 하드코딩되어 있습니다. 이 값들은 서로 논리적으로 강하게 연결되어 있지만, 코드상으로는 분리되어 있어 하나만 수정하고 다른 부분을 놓칠 경우 버그가 발생할 위험이 큽니다.
또한, ExamNumberGenerationJobRound1과 같이 시험 일정마다 새로운 잡 클래스를 생성하는 방식은 코드 중복을 야기하고 확장성을 저해합니다.
개선 제안:
장기적으로는 시험 일정(시험일, 수험번호 생성일 등)을 데이터베이스나 설정 파일에 저장하고, 이를 바탕으로 동적으로 Quartz 잡을 등록하는 일반화된 잡을 만드는 것을 고려해보시는 것이 좋습니다. JobDataMap을 사용하면 잡 실행 시 동적으로 시험 날짜를 전달할 수 있습니다.
// 예시: 동적 잡 등록
JobDetail jobDetail = JobBuilder.newJob(GenericExamNumberGenerationJob.class)
.withIdentity("examNumberJob-" + examId)
.usingJobData("examDate", "2025-10-26")
.build();
Trigger trigger = TriggerBuilder.newTrigger()
.withIdentity("examNumberTrigger-" + examId)
.withSchedule(CronScheduleBuilder.cronSchedule("0 0 3 22 10 ?")) // DB나 설정에서 읽어온 값
.forJob(jobDetail)
.build();
scheduler.scheduleJob(jobDetail, trigger);이러한 리팩토링은 코드 변경 없이 새로운 시험 일정을 추가하거나 수정할 수 있게 하여 시스템을 훨씬 유연하고 안정적으로 만듭니다.
✨ 구현한 기능
📢 논의하고 싶은 내용
🎸 기타