diff --git a/src/main/java/com/thirdparty/ticketing/domain/ticket/service/proxy/LettuceReservationServiceProxy.java b/src/main/java/com/thirdparty/ticketing/domain/ticket/service/proxy/LettuceReservationServiceProxy.java index d292dff2..266b8737 100644 --- a/src/main/java/com/thirdparty/ticketing/domain/ticket/service/proxy/LettuceReservationServiceProxy.java +++ b/src/main/java/com/thirdparty/ticketing/domain/ticket/service/proxy/LettuceReservationServiceProxy.java @@ -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); } @@ -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); } }