Skip to content

Commit

Permalink
fix: 락 이름 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
mirageoasis committed Aug 22, 2024
1 parent 0b75e47 commit 604657f
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,9 @@ private void performSeatAction(String seatId, Runnable action) {
int retryLimit = 5;
int sleepDuration = 300;
String lockPrefix = "seat:";
String lockKey = lockPrefix + seatId;
try {
while (retryLimit > 0 && !lettuceRepository.seatLock(lockPrefix + seatId)) {
while (retryLimit > 0 && !lettuceRepository.seatLock(lockKey)) {
retryLimit -= 1;
Thread.sleep(sleepDuration);
}
Expand All @@ -34,7 +35,7 @@ private void performSeatAction(String seatId, Runnable action) {
} catch (InterruptedException e) {
throw new TicketingException(ErrorCode.NOT_SELECTABLE_SEAT, e);
} finally {
lettuceRepository.unlock(seatId);
lettuceRepository.unlock(lockKey);
}
}

Expand Down

0 comments on commit 604657f

Please sign in to comment.