Skip to content

Commit 9abcd7f

Browse files
committed
fix: 대기열 중복 진입 로그 추가
1 parent cfd52aa commit 9abcd7f

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/main/java/TiCatch/backend/global/service/redis/RedisService.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,10 @@ public void setValues(String key, String value) {
2727

2828
public void addToWaitingQueue(Long ticketId, String userId) {
2929
String queueKey = WAITING_QUEUE_PREFIX + ticketId;
30-
redisTemplate.opsForZSet().remove(queueKey, userId); // 이미 대기열에 유저가 있으면 삭제
31-
log.info("중복 userId 대기열 삭제 처리");
30+
Long removeCount = redisTemplate.opsForZSet().remove(queueKey, userId);// 이미 대기열에 유저가 있으면 삭제
31+
if(removeCount != null && removeCount == 1L) {
32+
log.info("중복 userId 대기열 삭제 처리");
33+
}
3234
double score = System.currentTimeMillis();
3335
redisTemplate.opsForZSet().add(queueKey, userId, score);
3436
}

0 commit comments

Comments
 (0)