From 116724a845336d95c9108efcc4664faa5e0ac395 Mon Sep 17 00:00:00 2001 From: Leon <147289645+LeoninCS@users.noreply.github.com> Date: Tue, 30 Dec 2025 01:26:24 +0800 Subject: [PATCH] =?UTF-8?q?chore:=20=E6=B3=A8=E9=87=8A=E4=BB=8E=E8=8B=B1?= =?UTF-8?q?=E6=96=87=E6=94=B9=E4=B8=BA=E4=B8=AD=E6=96=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/internal/worker/socialworker.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/backend/internal/worker/socialworker.go b/backend/internal/worker/socialworker.go index 00065fd..58c975a 100644 --- a/backend/internal/worker/socialworker.go +++ b/backend/internal/worker/socialworker.go @@ -59,7 +59,7 @@ func (w *SocialWorker) Run(ctx context.Context) error { func (w *SocialWorker) handleDelivery(ctx context.Context, d amqp.Delivery) { if err := w.process(ctx, d.Body); err != nil { log.Printf("social worker: failed to process message: %v", err) - // Retry on DB/transient errors. + // 重新入队,稍后重试 _ = d.Nack(false, true) return } @@ -69,7 +69,7 @@ func (w *SocialWorker) handleDelivery(ctx context.Context, d amqp.Delivery) { func (w *SocialWorker) process(ctx context.Context, body []byte) error { var evt rabbitmq.SocialEvent if err := json.Unmarshal(body, &evt); err != nil { - // Poison message: drop it to avoid infinite retry loop. + // 解析事件失败,直接丢弃 return nil } if evt.FollowerID == 0 || evt.VloggerID == 0 {