refactor(p0-5): 收敛热度相关注释

背景叙述与历史取舍已写进 `docs/design/hot-ranking.md`,从源码删除。
只保留不变式与安全约束:`clientFoundRows` 禁令、唯一索引判重、
成员补零的排序约定、快照用 `RENAMENX` 只建一次、`EXPIRE` 失败即删键。

`video_service.go` 的 `NewVideoService` 注释原本复述已删方法的来历,一并收敛。
`zset.go` 的 `ZUnionStore` 与 `RenameNX` 注释各压到四行以内。

验证:go build ./... 通过。
验证:go vet ./... 通过。
验证:go test -count=1 ./... 全绿(本机无 cgo,未跑 -race)。
验证:go test -tags integration -p 1 -count=1 ./internal/feed/ ./internal/video/ ./internal/worker/ 全绿。
This commit is contained in:
2026-11-01 16:47:31 +08:00
parent 006ec5f196
commit d782ccbb53
16 changed files with 74 additions and 132 deletions

View File

@@ -74,8 +74,7 @@ func (w *CommentWorker) applyPublish(ctx context.Context, evt *rabbitmq.CommentE
AuthorID: evt.AuthorID,
Content: strings.TrimSpace(evt.Content),
// 行时间来自事件:桶必须落在评论发生的那一分钟。
// 事件没带时间时保持零值,由 GORM 的 autoCreateTime 补当前时刻,
// 并回填到这个字段,因此下面的落桶仍与行一致。
// 零值时由 GORM 的 autoCreateTime 补当前时刻并回填到这个字段。
CreatedAt: evt.OccurredAt,
}
// event_id 即意图键:API 已直写时这里会命中唯一索引。