Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import com.practice.course_registration.global.redis.utils.RedisKeyUtils;
import java.time.Duration;
import lombok.RequiredArgsConstructor;
import org.springframework.boot.autoconfigure.cache.CacheProperties.Redis;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.stereotype.Service;

Expand All @@ -20,7 +19,6 @@ public class IdempotencyService {
public boolean rateLimitAllow(Long memberId, int limit, Duration ttl) {
String key = RedisKeyUtils.rateLimitKey(memberId);
Long cnt = stringRedisTemplate.opsForValue().increment(key);
System.out.println("cnt : " + cnt);
// 첫 요청인 경우 -> TTL 1로 세팅
if (cnt != null && cnt == 1L) {
stringRedisTemplate.expire(key, ttl);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public void issue() {
try {
long cnt = luaRepository.publishIssueTokens(PERMITS_PER_TICKS, TOKEN_TTL);
if (cnt > 0) {
log.info("토큰 발급 성공: count={}, sample={}", cnt);
log.info("토큰 발급 성공: count={}", cnt);
}
} catch (Exception e) {
log.error("토큰 발급 실패", e);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package com.practice.course_registration.global.redis.service;

import com.practice.course_registration.global.redis.utils.RedisKeyUtils;
import java.time.Duration;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.data.redis.core.StringRedisTemplate;
Expand Down
Loading