Skip to content

Commit

Permalink
fix: like key prefix 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
mcodnjs committed Jan 30, 2024
1 parent 4583c0e commit 68882fe
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@

public class LikeRedisConstants {

public static final String LIKE_KEY_PREFIX = "like:*";
public static final String LIKE_KEY_PREFIX = "like:";
public static final String WILD_CARD = "*";
public static final String KEY_SEPARATOR = ":";
public static final String EMPTY_MARKER = "empty";
public static final Duration LIKE_TTL = Duration.ofMinutes(90L);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import static hanglog.like.domain.LikeRedisConstants.EMPTY_MARKER;
import static hanglog.like.domain.LikeRedisConstants.LIKE_KEY_PREFIX;
import static hanglog.like.domain.LikeRedisConstants.KEY_SEPARATOR;
import static hanglog.like.domain.LikeRedisConstants.WILD_CARD;
import static hanglog.like.domain.LikeRedisConstants.generateLikeKey;

import hanglog.like.domain.Likes;
Expand Down Expand Up @@ -32,7 +33,7 @@ public class LikeSyncScheduler {

@Scheduled(cron = "0 0 * * * *")
public void writeBackLikeCache() {
final Set<String> likeKeys = redisTemplate.keys(LIKE_KEY_PREFIX);
final Set<String> likeKeys = redisTemplate.keys(LIKE_KEY_PREFIX + WILD_CARD);
if (Objects.isNull(likeKeys)) {
return;
}
Expand Down

0 comments on commit 68882fe

Please sign in to comment.