-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[REFACTOR] 네임드 락을 이용해 분산 락 구현, 픽 수정 시 트랜잭션 추가 (#665)
* refactor: RabbitmqConfig 위치 이동 * refactor: 폴더 비관적 락 제거 * refactor: RabbitMqConfig 위치 이동 * feat: 네임드 락을 이용한 분산 락 구현 * refactor: 깨지는 테스트 수정 * refactor: 폴더 삭제 시 데드락 문제 재현을 위한 테스트 * refactor: Link Lazy Loading 에러 해결을 위해 트랜잭션 추가 * refactor: 주석 추가 * refactor: 코드 리뷰 반영 및 api 모듈로 이동 * refactor: userId 리플렉션으로 받아오는 부분 @LoginUserId 사용하도록 변경 * refactor: validateGivenFoldersAreAllPrivate 제거 * refactor: 위치 변경 및 주석 제거
- Loading branch information
1 parent
008e602
commit efc3352
Showing
16 changed files
with
446 additions
and
285 deletions.
There are no files selected for viewing
20 changes: 20 additions & 0 deletions
20
backend/techpick-api/src/main/java/techpick/api/annotation/LoginUserIdDistributedLock.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package techpick.api.annotation; | ||
|
||
import java.lang.annotation.ElementType; | ||
import java.lang.annotation.Retention; | ||
import java.lang.annotation.RetentionPolicy; | ||
import java.lang.annotation.Target; | ||
|
||
/** | ||
* @author sangwon | ||
* key : 락을 걸 이름을 지정합니다. | ||
* 실제로 락 이름은 key + _ + userId로 설정합니다. | ||
* 분산 락을 걸어서 동시성 문제를 제어합니다. | ||
*/ | ||
@Target(ElementType.METHOD) | ||
@Retention(RetentionPolicy.RUNTIME) | ||
public @interface LoginUserIdDistributedLock { | ||
String key(); | ||
|
||
long timeout() default 3000; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.