fix: 点赞后失效推荐列表的 video:entity 缓存

UpdatePopularityCache 只失效了 video:detail 缓存,
未失效 feed 使用的 video:entity 缓存(1h TTL),
导致推荐列表 likes_count 长时间显示为旧值
This commit is contained in:
yiyiis
2026-05-23 00:36:02 +08:00
parent 28408606f4
commit 33c0bd418c

View File

@@ -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"))