fix: 点赞后失效推荐列表的 video:entity 缓存
UpdatePopularityCache 只失效了 video:detail 缓存, 未失效 feed 使用的 video:entity 缓存(1h TTL), 导致推荐列表 likes_count 长时间显示为旧值
This commit is contained in:
@@ -15,6 +15,7 @@ func UpdatePopularityCache(ctx context.Context, cache *rediscache.Client, id uin
|
||||
}
|
||||
|
||||
_ = cache.Del(context.Background(), cache.Key("video:detail:id=%d", id))
|
||||
_ = cache.Del(context.Background(), cache.Key("video:entity:%d", id))
|
||||
|
||||
now := time.Now().UTC().Truncate(time.Minute)
|
||||
windowKey := cache.Key("hot:video:1m:%s", now.Format("200601021504"))
|
||||
|
||||
Reference in New Issue
Block a user