auto-sync: 2026-06-09 08:06:43

This commit is contained in:
cfdaily
2026-06-09 08:06:43 +08:00
parent 795cfa81d1
commit cf7e136330
+5 -1
View File
@@ -66,10 +66,14 @@ def _is_duplicate(event: str, delivery: str, payload: Optional[Dict[str, Any]] =
return True
# 检查 payload 内容去重(review 事件:同一 PR + 同一用户 + 同一内容)
# 注意:Gitea webhookNotifier 用 review.bodyactionsNotifier 用 review.content
# 所以去重 key 需要同时取两个字段,确保两种格式生成相同 key
if payload and "review" in event:
pr_num = payload.get("pull_request", {}).get("number")
sender = payload.get("sender", {}).get("login")
content = payload.get("review", {}).get("content", "")
review = payload.get("review", {})
# 取 body 或 content,优先 bodywebhookNotifier 格式)
content = review.get("body", "") or review.get("content", "")
content_key = f"content:{event}:{pr_num}:{sender}:{content}"
if content_key in _delivery_cache:
logger.info("Content-based duplicate detected: %s PR#%s by %s", event, pr_num, sender)