Skip to content

Commit

Permalink
Merge pull request #45
Browse files Browse the repository at this point in the history
fix: concurrency exception in save User (add synchronized)
  • Loading branch information
in-seo authored Oct 1, 2024
2 parents 5dacd84 + 5b4e4e8 commit 08ee68f
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public OAuth2User loadUser(OAuth2UserRequest userRequest) throws OAuth2Authentic
}

// 유저 생성 및 수정 서비스 로직
private User saveOrUpdate(OAuthAttributes attributes){
private synchronized User saveOrUpdate(OAuthAttributes attributes){
Optional<CoveringUser> optionalUser = userRepository.findByEmailWithIndex(attributes.getEmail()); // id, email, role만 가져오는 커버링 인덱스!
if(optionalUser.isPresent())
return new User(optionalUser.get());
Expand Down

0 comments on commit 08ee68f

Please sign in to comment.