Skip to content

feat: crom ranking, rule-site attribution scores, crawler perf - #8

Open
umouyoumou-del wants to merge 1 commit into
WikitTeam:mainfrom
umouyoumou-del:feat/crom-ranking-crawler-perf
Open

feat: crom ranking, rule-site attribution scores, crawler perf#8
umouyoumou-del wants to merge 1 commit into
WikitTeam:mainfrom
umouyoumou-del:feat/crom-ranking-crawler-perf

Conversation

@umouyoumou-del

@umouyoumou-del umouyoumou-del commented Aug 21, 2026

Copy link
Copy Markdown
Collaborator

概述

本 PR 合并近期未入库的全量工作:crom 排行集成、规则怪谈档案馆归属分数、(user deleted) 过滤、作者活力图修复、爬虫性能优化,以及此次追加的 CROM 站点跳过 + 连接池修复

因 github.com 直连推送被阻断,本分支通过 Git Data API 以单个 squash commit 推送到 fork。

主要变更

1. 爬虫性能优化(~5x,已部署)

  • auto-crawler.jsCONCURRENCY 2→5,批次 sleep 2.5s→600ms,listpages 间隔 1s→300ms,maxSockets 10→20
  • userIdCache 改为全局复用,投票 upsert 改用 Promise.all 并行

2. CROM 站点跳过(本次新增)

  • auto-crawler.js:对配置了 CROM_API 的站点(brcn、na、if)直接跳过逐页爬取,由 auto-attribution.js 通过 crom API 处理数据
  • 解决 brcn 8375 页(wikit listpages 含所有页面类型)爬取数小时 + 连接池耗尽的问题
  • 非 CROM 站点仍保留讨论区/投票抓取

3. Prisma 连接池修复(本次新增)

  • lib/prisma.js:连接池从默认 9 增至 20,超时从 10s 增至 30s
  • 解决 auto-crawler + auto-attribution 并发时 Timed out fetching a new connection 错误

4. 管理面板显示修复(本次新增)

  • pages/api/admin/crawler-status.js:CROM 站点标记为 skipped 状态
  • pages/admin.js:新增"归属服务"徽章(天蓝色),避免 CROM 站点一直显示"等待"

5. 其他(此前合入)

  • crom 排行集成、规则怪谈档案馆归属分数、(user deleted) 全链路过滤、作者活力图修复等

验证

  • node --check 全部通过
  • ✅ 已部署至生产服务器(wikitdb.cn)
  • ✅ auto-crawler 日志确认跳过 if 站点(跳过 if(crom 站点,由 attribution 服务处理)
  • ✅ brcn/na 状态已从 error 重置为 pending(将由 attribution 服务处理)
  • ✅ attribution 服务正常处理 brcn(575 作者、8399 页面)和 na(70 作者、504 页面)

变更范围

15 文件(含新增的 lib/prisma.js 修改、crawler-status.js、admin.js)

- crom: add nationarea site, fix pagination (first=50 + cursor) & field
  names (User.attributedPages), skip pageCount=0 cross-site users
- ranking: filter '(user deleted)'; use attribution scores for rule-site
  authors not in Wikit CIL, override Wikit 0 scores
- authors: crom data source labels, empty-state prompts, activity chart
  dual-prop (pages/data) + monthly aggregation
- crawler: CONCURRENCY 2->5, batch sleep 2.5s->600ms, listpages sleep
  1s->300ms, maxSockets 10->20, global userIdCache, parallel vote
  upserts via Promise.all (~5x throughput)
- config: drop CROM_API for rule site (keep ATTRIBUTION_PAGE), add na
  crom site, fix 'Bsckrooms'->'Backrooms'
- search: JSON deserialization compat for legacy string data

Plus prior unmerged work (staff panel, admin endpoints, save-page tooling,
SMTP test script). Squash-pushed via Git Data API due to github.com direct
push block.
@umouyoumou-del
umouyoumou-del force-pushed the feat/crom-ranking-crawler-perf branch from 9340173 to a8b4ed1 Compare August 21, 2026 16:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant