-
Notifications
You must be signed in to change notification settings - Fork 0
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: fcm 푸시 알림 스케줄러에 등록 #89
Conversation
@@ -21,6 +22,7 @@ public interface MissionMemberRepository extends JpaRepository<MissionMember, Lo | |||
@Query("SELECT mm FROM MissionMember mm JOIN FETCH mm.mission WHERE mm.member.id = :memberId") | |||
List<MissionMember> findAllWithMissionByMemberId(final Long memberId); | |||
|
|||
@Lock(LockModeType.PESSIMISTIC_WRITE) |
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.
미션 인증 2번 가능한 문제 해결하려고 lock 걸었습니다..!
@Transactional
public void createVerification(final CreateMissionVerificationCommand command) {
MissionMember missionMember = missionMemberRepository.getMissionMember(command.memberId(), command.missionId());
missionVerificationValidator.validate(missionMember);
String imageUrl = objectStorageClient.uploadFile(command.imageFile());
missionMember.verify();
missionVerificationRepository.save(new MissionVerification(missionMember.getMember(), missionMember.getMission(), imageUrl, missionMember.getVerificationCount()));
}
커넥션이 여러 개라서 2개 이상의 커넥션이 같은 상태의 missionMember
레코드를 읽는 게 원인인 것 같습니다 (그래서 유효성 검사를 해도 insert가 되는,,,)
더 나은 방법이나 오류 사항이 있으면 편하게 말씀해주세요 🙏
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.
우리 Redis 쓰고 있으니까 레디스 락 걸어보는 것도 괜찮을 것 같앙
추후에 계속해서 사용될 수 있는 쿼리 같아서 DB 락 보다는 필요한 곳에 레디스 락 거는게 조금 더 가볍지 않을까 생각하는데 지금 당장 중요한 부분은 아니라 백로그로 남겨도 좋을 것 같아!
.../java/com/nexters/goalpanzi/application/mission/event/handler/MissionMemberEventHandler.java
Show resolved
Hide resolved
src/main/java/com/nexters/goalpanzi/domain/mission/MissionStatus.java
Outdated
Show resolved
Hide resolved
src/main/java/com/nexters/goalpanzi/schedule/MissionCancellationWarningPushJob.java
Outdated
Show resolved
Hide resolved
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.
고생 많았습니다 ⭐️👍⭐️
Issue Number
close: #
작업 개요
(#84 구현중)
스케줄러가 필요한 푸시 알림 구현
작업 사항
MissionReadyPushJob
MissionCancellationWarningPushJob
MissionVerificationPushJob
MissionVerificationWarningPushJob
고민한 점들(필수 X)
hasEnoughMember
함수를 중복해서 정의하고 있는데 어떻게 개선할지 고민입니다.스크린샷(필수 X)