-
Notifications
You must be signed in to change notification settings - Fork 2
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
feat: 종료미션 DurationStatus 추가 및 스케줄러 구현 #181
Conversation
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.
패키지 domain쪽보단 따로 scheduler로 빼서 거기에 넣는게 좋아보입니당
그리구 메소드명 complete보다 DurationStatus에 맞게 finish로 사용하면 어떨까용?
@Component | ||
@RequiredArgsConstructor | ||
public class MissionBatchJob { | ||
private final MissionService missionService; | ||
|
||
public void updateCompleteDurationStatus() { | ||
missionService.updateCompleteDurationStatus(); | ||
} | ||
} |
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.
MissionBatchJob 객체 없이 MissionBatchScheduler 에서 바로 service 호출해서 사용하는게 좋아보여용
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.
배치 영역과 스케줄러 영역 분리가 필요할까봐 했었는데 지금은 없이하는게 나을 듯 하네용👍
@Modifying | ||
@Query(value = "update Mission m set m.durationStatus='FINISHED' where m.finishedAt <= NOW()") | ||
void updateMissionDurationStatusComplete(); |
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.
now() 했을 때 시간이 정확히 00시 00분이 아닐 경우도 생길 것 같아서
어플리케이션 단에서 시간을 맞춰서 쿼리하는게 좋을 것 같은데 어떻게 생각하세용?
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.
넵 저도 좋다고 생각해용
|
||
@EnableScheduling |
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.
Config로 따로 빼도 좋을 것 같아용
@EnableScheduling | ||
@Configuration | ||
public class BatchConfig {} |
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.
스케줄링을 통해 정해진 시간에 행위를 할 뿐 배치처리라고 보긴 어려워서
Batch보다는 Scheduler가 맞는 표현인 것 같아용
@Modifying | ||
@Query( | ||
value = | ||
"update Mission m set m.durationStatus='FINISHED' where m.finishedAt <= :today and m.durationStatus != 'FINISHED'") | ||
void updateFinishedDurationStatus(@Param("today") LocalDateTime today); |
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.
durationStatus enum의 FINISHED의 값이 변경되었을 때, 버그가 발생할 수 있는 포인트라고 생각되는데,
QueryDsl을 사용하면 컴파일단계에서 에러를 잡을 수 있는 이점이 있다고 생각하는데 어떻게 생각하시나용??
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.
좋아용 반영해서 push 했습니다!
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.
LGTM~
고생하셨습니당
Quality Gate passedThe SonarCloud Quality Gate passed, but some issues were introduced. 37 New issues |
🌱 관련 이슈
📌 작업 내용 및 특이사항
📝 참고사항
📚 기타