fix(wiki-ingest,asynqdl): review fixups for PR #1241

- repo: drop r.db.Debug() from FindSimilarPages — it was dumping every
  trigram probe's SQL+args (per-alias, per-item) into production logs.
- wiki_ingest dedup: fix Printf format string ("selected for %d new
  items" had two args), and harden validMerge against un-prefixed
  slugs whose strings.Index returned -1 and silently passed the type
  check.
- wiki_ingest_batch: drop the duplicated loggedBatchSize/MapPar/
  ReducePar assignments.
- asynqdl: record the real attempt count (retried + 1) on the dead
  letter row instead of a hard-coded 0; tighten payloadProbe to the
  set of field names with consistent semantics across payloads
  (drop source_id/target_id/target_kb_id which differ by task type).
- asynqdl tests: update for the trimmed probe and assert FailCount=0
  outside an asynq worker ctx so the semantics stay pinned.
This commit is contained in:
wizardchen
2026-05-09 23:59:12 +08:00
committed by lyingbug
parent 04e8105728
commit 82947c726e
5 changed files with 63 additions and 35 deletions
+1 -1
View File
@@ -628,7 +628,7 @@ func (r *wikiPageRepository) FindSimilarPages(
q := strings.ToLower(strings.TrimSpace(query))
var rows []types.WikiPageLite
if err := r.db.Debug().WithContext(ctx).
if err := r.db.WithContext(ctx).
Model(&types.WikiPage{}).
Select("slug, title, page_type, status, aliases, out_links, similarity(lower(title), ?) AS sim", q).
Where("knowledge_base_id = ? AND page_type IN ? AND status <> ? AND lower(title) % ?",