-
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
Fix/#547 킬링파트 여러 사용자 동시 좋아요 누를 때 동시성 이슈 해결 #548
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.
바론 !!!!!!!! 고생 많았습니다. 이걸로 저희가 많이 골머리 썩였는데 드디어 해결되네요 ^^
코드 변경이 많지 않아 간단한 리뷰만 남겼습니다 :) 바로 머지 가도 무관할 것 같아요!
final Optional<KillingPartLike> like = killingPart.findLikeByMember(member); | ||
like.ifPresent(likeOnKillingPart -> { |
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.
하나로 묶는 거에 대해서는 어떻게 생각하세요?
final Optional<KillingPartLike> like = killingPart.findLikeByMember(member); | |
like.ifPresent(likeOnKillingPart -> { | |
killingPart.findLikeByMember(member).ifPresent(likeOnKillingPart -> { |
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.
원래 그냥 if문으로 처리했다가 ifPresent
로 바꾸면서 오 좋은데~~ 라고 생각했었는데,,, 이걸 하나로 줄일 생각은 또 왜 못했을까요?
감사합니다 eagle eye vero
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.
My Pleasure.
@>----------
@@ -32,4 +33,12 @@ List<SongKillingPartKillingPartLikeCreatedAtDto> findLikedKillingPartAndSongByMe | |||
+ "FROM KillingPartLike kp_like " | |||
+ "WHERE kp_like.member=:member and kp_like.isDeleted=false") | |||
List<Long> findLikedKillingPartIdsByMember(@Param("member") final Member member); | |||
|
|||
@Query("update KillingPartLike kp_like set kp_like.isDeleted = false where kp_like.id = :id") | |||
@Modifying(clearAutomatically = true, flushAutomatically = true) |
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.
굿입니다 👍🏻
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.
부끄럽네요 (^///^) --<-<-<@
📝작업 내용
킬링파트 여러 사용자 동시 좋아요 누를 때 동시성 이슈 해결
💬리뷰 참고사항
한 사용자가 여러 번 좋아요를 눌러서 좋아요가 동시에 도착하는 경우에 대해서는 처리가 되지 않습니다.
이미 프론트엔드 측에서 좋아요 버튼이 연속해서 눌리는 부분에 대해 처리가 되어있는 것으로 알고 있어서, 처리하지 않아도 무방할 것이라 생각했습니다. 이 부분에 대한 내용은 아래 링크를 참고해주세용!
https://somsom13.notion.site/36cd63ee0c5142e3be0a245d1c4e4928?pvs=4
#️⃣연관된 이슈
fix #547