Skip to content

Commit

Permalink
feat: member가 변경되면 로컬 캐시 업데이트 되도록 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
Curry4182 committed Apr 26, 2024
1 parent c938a07 commit 93ccec4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,8 @@
public enum CacheType {

REFRESH_TOKEN("refreshToken", 1209600, 10000),
CHAT_CACHE("chat", 30, 500000),
MEMBER_CACHE("member", 30, 10000),
SESSION_CACHE("sessionCache", 60, 10000);
CHAT_CACHE("chat", 3600, 500000),
MEMBER_CACHE("member", 300, 10000);

private final String cacheName;
private final int expireAfterWrite;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.programmers.lime.domains.member.implementation;

import org.springframework.cache.annotation.CachePut;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;

Expand All @@ -18,6 +19,7 @@ public class MemberModifier {
private final MemberChecker memberChecker;

@Transactional
@CachePut(value = "member", key = "#member.id", condition = "#member.id != null")
public void modifyProfile(
final Member member,
final String nickname,
Expand All @@ -31,6 +33,7 @@ public void modifyProfile(
}

@Transactional
@CachePut(value = "member", key = "#member.id", condition = "#member.id != null")
public void modifyRole(
final Member member,
final Role role
Expand All @@ -39,6 +42,7 @@ public void modifyRole(
}

@Transactional
@CachePut(value = "member", key = "#member.id", condition = "#member.id != null")
public void modifyProfileImage(
final Member member,
final String directory,
Expand Down

0 comments on commit 93ccec4

Please sign in to comment.