Open
Conversation
🔗 Resolves: #be/feat/317
🔗 Resolves: #be/feat/317
🔗 Resolves: #be/feat/317
🔗 Resolves: #be/feat/319
🔗 Resolves: #be/feat/319
🔗 Resolves: #be/feat/319
🔗 Resolves: #be/feat/319
🔗 Resolves: #be/feat/319
🔗 Resolves: #be/feat/319
🔗 Resolves: #be/feat/319
🔗 Resolves: #be/feat/319
🔗 Resolves: #be/feat/319
🔗 Resolves: #be/feat/319
🔗 Resolves: #be/feat/317
🔗 Resolves: #be/feat/317
JangBJ
reviewed
May 13, 2025
| } | ||
|
|
||
| public <T> T executeWithLock(String lockName, long waitTime, long leaseTime, Supplier<T> supplier) { | ||
| public <T> T executeWithLock(String lockName, long waitTime, long leaseTime, int retryCount, Supplier<T> supplier) { |
| log.debug("락 얻기 시도 ({}/{}): {}", attempts + 1, retryCount, lockName); | ||
| isLocked = lock.tryLock(waitTime, leaseTime, TimeUnit.SECONDS); | ||
|
|
||
| if (!isLocked) { |
Contributor
There was a problem hiding this comment.
락 얻기 실패했을경우 별도로 다른 처리가 필요 하지 않을까요?
| try { | ||
| lock.unlock(); | ||
| log.debug("락 해제: {}", lockName); | ||
| } catch (Exception e) { |
Contributor
There was a problem hiding this comment.
락 해제에 실패했을때도 별도의 처리가 있어야하지 않을까요?
| private static final String STOCK_GLOBAL_LOCK = "global:stock:lock"; | ||
| private static final int CACHE_TTL_HOURS = 72; | ||
|
|
||
| // Redis에서 재고 확인, 없으면 DB에서 조회하여 캐싱 |
Contributor
There was a problem hiding this comment.
왜 Redis를 이용한 분산 재고 처리를 하셨는지 궁금합니다
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🚀 어떤 기능을 구현했나요 ?
🔥 어떤 문제를 마주했나요 ?
✨ 어떻게 해결했나요 ?
📝 어떤 부분에 집중해서 리뷰해야 할까요?
📚 참고 자료 및 회고