feat: implement background job system with queue, worker, scheduler, and handlers

- Add job queue abstraction (InMemoryQueue and Redis/BullMQ adapter)
- Add polling worker with retry logic and exponential backoff
- Add 6 job handlers: darkwatch.scan, voiceprint.batch, hometitle.scan,
  removebrokers.process, reports.generate, notifications.send
- Add cron-based scheduler with tier-appropriate frequencies
  (Basic/Plus/Premium)
- Add tRPC scheduler router for admin (runJobNow, getJobStatus, etc.)
- Add entry point with graceful shutdown support
- Achieve 100% test pass rate for new job system
This commit is contained in:
2026-05-25 17:16:21 -04:00
parent 659ab9b71a
commit eb8e57c674
19 changed files with 1429 additions and 0 deletions

View File

@@ -24,9 +24,12 @@
"@types/three": "^0.184.1",
"@typeschema/valibot": "^0.13.4",
"bcryptjs": "^3.0.3",
"bullmq": "^5.77.3",
"drizzle-orm": "^0.45.2",
"firebase-admin": "^13.10.0",
"ioredis": "^5.10.1",
"jose": "^5",
"node-cron": "^4.2.1",
"pg": "^8.21.0",
"puppeteer": "^25.0.4",
"resend": "^6.12.4",
@@ -42,6 +45,7 @@
"node": ">=22"
},
"devDependencies": {
"@types/node-cron": "^3.0.11",
"@types/pg": "^8.20.0",
"drizzle-kit": "^0.31.10",
"jsdom": "^29.1.1",