From bc1252e66cf05deb7e1449ded40a27dd2418c8b4 Mon Sep 17 00:00:00 2001 From: huanghaosheng <386998068@qq.com> Date: Sun, 1 Nov 2026 15:15:40 +0800 Subject: [PATCH] =?UTF-8?q?docs(agents):=20=E6=9B=B4=E6=96=B0=20Worker=20?= =?UTF-8?q?=E6=AE=B5=E8=90=BD=E4=B8=BA=E4=B8=89=E4=B8=AA=E6=B6=88=E8=B4=B9?= =?UTF-8?q?=E8=80=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 删除 Popularity worker。worker 进程现在只跑 Social、Like 与 Comment 三个消费者。 补上热度的两句话。计数由业务事务写,热榜是派生滑窗,可用 cmd/reconcile 重建。 验证:文档改动,无命令。 --- AGENTS.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/AGENTS.md b/AGENTS.md index 057dda9..6fb0d29 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -62,7 +62,7 @@ CONFIG_PATH=configs/config.compose-local.yaml go run ./cmd/worker # Worker ### Dual Binary Split - `backend/cmd/main.go` — Gin HTTP API server (port 8080, pprof on :6060) -- `backend/cmd/worker/main.go` — RabbitMQ consumer process (pprof on :6061). Runs the Social, Like, Comment, and Popularity workers in independent goroutines; each gets its own AMQP channel from the shared connection manager and reconnects automatically. (Notification workers, the Outbox poller, and the timeline consumer currently live in the API process — see `router.go`.) +- `backend/cmd/worker/main.go` — RabbitMQ consumer process (pprof on :6061). Runs the Social, Like, and Comment workers in independent goroutines; each gets its own AMQP channel from the shared connection manager and reconnects automatically. Interaction counts are written by the business transaction (`ApplyLike`/`ApplyUnlike`/`CreateIdempotentWithPopularity`/`DeleteWithPopularity`); the hot ranking is a derived 60-minute sliding window (`video.ApplyHotDelta`, best-effort after commit, rebuildable with `cmd/reconcile -rebuild-hot`). (Notification workers, the Outbox poller, and the timeline consumer currently live in the API process — see `router.go`.) ### Domain Layer Pattern