fix(live-room): 최근 종료 라이브 조회와 캐시 무효화를 최적화한다
This commit is contained in:
@@ -120,6 +120,7 @@ class MemberService(
|
||||
private val tokenLocks: MutableMap<Long, ReentrantReadWriteLock> = mutableMapOf()
|
||||
|
||||
private val recommendLiveCacheKeyPrefix = "getRecommendLive:"
|
||||
private val latestFinishedLiveCacheKeyPrefix = "getLatestFinishedLive:"
|
||||
|
||||
@Transactional
|
||||
fun signUpV2(request: SignUpRequestV2): SignUpResponse {
|
||||
@@ -564,7 +565,11 @@ class MemberService(
|
||||
}
|
||||
|
||||
evictRecommendLiveCache(memberId)
|
||||
blockTargetMemberIds.forEach { evictRecommendLiveCache(it) }
|
||||
evictLatestFinishedLiveCache(memberId)
|
||||
blockTargetMemberIds.forEach {
|
||||
evictRecommendLiveCache(it)
|
||||
evictLatestFinishedLiveCache(it)
|
||||
}
|
||||
}
|
||||
|
||||
@Transactional
|
||||
@@ -580,6 +585,8 @@ class MemberService(
|
||||
|
||||
evictRecommendLiveCache(memberId)
|
||||
evictRecommendLiveCache(request.blockMemberId)
|
||||
evictLatestFinishedLiveCache(memberId)
|
||||
evictLatestFinishedLiveCache(request.blockMemberId)
|
||||
}
|
||||
|
||||
fun isBlocked(blockedMemberId: Long, memberId: Long) = blockMemberRepository.isBlocked(blockedMemberId, memberId)
|
||||
@@ -843,6 +850,10 @@ class MemberService(
|
||||
cacheManager.getCache("cache_ttl_3_hours")?.evict(recommendLiveCacheKeyPrefix + memberId)
|
||||
}
|
||||
|
||||
private fun evictLatestFinishedLiveCache(memberId: Long) {
|
||||
cacheManager.getCache("cache_ttl_10_minutes")?.evict(latestFinishedLiveCacheKeyPrefix + memberId)
|
||||
}
|
||||
|
||||
@Transactional
|
||||
fun updateMarketingInfo(memberId: Long, adid: String, pid: String): String? {
|
||||
val member = repository.findByIdOrNull(id = memberId)
|
||||
|
||||
Reference in New Issue
Block a user