Files
AIclinicalresearch/docs/08-项目管理/PKB迁移-阶段2进行中.md
HaHafeng 61cdc97eeb feat(platform): Fix pg-boss queue conflict and add safety standards
Summary:
- Fix pg-boss queue conflict (duplicate key violation on queue_pkey)
- Add global error listener to prevent process crash
- Reduce connection pool from 10 to 4
- Add graceful shutdown handling (SIGTERM/SIGINT)
- Fix researchWorker recursive call bug in catch block
- Make screeningWorker idempotent using upsert

Security Standards (v1.1):
- Prohibit recursive retry in Worker catch blocks
- Prohibit payload bloat (only store fileKey/ID in job.data)
- Require Worker idempotency (upsert + unique constraint)
- Recommend task-specific expireInSeconds settings
- Document graceful shutdown pattern

New Features:
- PKB signed URL endpoint for document preview/download
- pg_bigm installation guide for Docker
- Dockerfile.postgres-with-extensions for pgvector + pg_bigm

Documentation:
- Update Postgres-Only async task processing guide (v1.1)
- Add troubleshooting SQL queries
- Update safety checklist

Tested: Local verification passed
2026-01-23 22:07:26 +08:00

636 B

PKB迁移 - 阶段2进行中

🔧 当前问题

问题: pkbRoutes导入错误 原因: 使用了命名导出而非默认导出

解决方案

修改 src/index.ts 的导入语句:

// ❌ 错误(命名导出)
import { pkbRoutes } from './modules/pkb/index.js';

// ✅ 正确(默认导出)
import pkbRoutes from './modules/pkb/routes/index.js';

📝 已完成

  • 创建PKB模块路由入口
  • 添加健康检查端点
  • 在主路由注册PKB模块
  • 修复导入语句

⏭️ 下一步

  • 重启服务器测试
  • 验证新旧路由都可用