[UPLUS-144] feat: 스케줄러 작동 시 invMonth 자동 주입#12
Conversation
Summary of ChangesHello @arkchive, 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! 이 PR은 배치 스케줄러의 실행 안정성과 편의성을 향상시키는 데 중점을 둡니다. 'invMonth' 매개변수에 대한 기본값을 제공하여 스케줄러 실행 시 유연성을 높이고, 애플리케이션의 실행 타입을 명확히 설정하여 배치 환경에 최적화했습니다. Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. 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
|
There was a problem hiding this comment.
Code Review
이번 PR은 스케줄러를 통해 배치 잡을 실행할 때 invMonth 파라미터가 없는 경우, 현재 년월을 자동으로 주입하도록 개선하는 내용을 담고 있습니다. Optional을 사용하여 파라미터 부재 시 NullPointerException이 발생할 수 있는 가능성을 제거하고, 기본값을 제공하는 방식은 좋은 접근입니다. 또한, 배치 애플리케이션에 맞게 web-application-type을 none으로 설정하여 불필요한 웹 서버가 실행되지 않도록 한 점도 올바른 변경입니다. 코드 리뷰에서는 DateTimeFormatter를 매번 생성하는 대신 상수로 만들어 재사용하여 성능을 개선하는 방안을 제안했습니다.
| LocalDate.now() | ||
| .format(DateTimeFormatter.ofPattern("yyyyMM"))); |
There was a problem hiding this comment.
DateTimeFormatter 객체는 불변(immutable)이고 스레드에 안전(thread-safe)합니다. 따라서 매번 ofPattern()을 호출하여 새로 생성하는 것보다 static final 상수로 선언하여 재사용하는 것이 성능에 더 유리합니다. 클래스 수준에서 상수로 정의하여 사용하는 것을 권장합니다.
예시:
// BatchJobRunner.java 클래스에 상수 추가
private static final DateTimeFormatter YYYYMM_FORMATTER = DateTimeFormatter.ofPattern("yyyyMM");
// ... run() 메서드 내부에서 사용
.format(YYYYMM_FORMATTER)
SonarQube Quality Summary (Community)✅ Quality Gate PASSED Branch: Issues
Measures
🔗 Dashboard: https://sonarqube.swthewhite.store/dashboard?id=batch-core&branch=feat/UPLUS-144 Generated automatically by GitHub Actions. |
SonarQube Quality Summary (Community)❌ Quality Gate FAILED Branch: Issues
Measures
🔗 Dashboard: https://sonarqube.swthewhite.store/dashboard?id=batch-core&branch=feat/UPLUS-144 Generated automatically by GitHub Actions. |
🎫 지라 티켓
UPLUS-144
✅ 작업 사항
📋 체크리스트
⌨ 기타