Skip to content

Commit 7d96fdb

Browse files
authored
Merge pull request #288 from prgrms-aibe-devcourse/feat/view_count
Refactor: IP기반 조회수 증가 24 > 1시간으로 변경
2 parents c097e81 + 719c99b commit 7d96fdb

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/main/java/kr/co/amateurs/server/service/post/ViewCountService.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ public boolean incrementViewCount(Long postId, String clientIp) {
3333
String ipKey = VIEW_IP_KEY + postId + ":" + clientIp;
3434

3535
Boolean isNewView = redisTemplate.opsForValue()
36-
.setIfAbsent(ipKey, "1", Duration.ofHours(24));
36+
.setIfAbsent(ipKey, "1", Duration.ofHours(1));
3737

3838
if (Boolean.TRUE.equals(isNewView)) {
3939
redisTemplate.opsForHash().increment(VIEW_COUNT_HASH, postId.toString(), 1);

0 commit comments

Comments
 (0)