由外部 agent (Codex) 在本会话额度中断期间完成。原样提交作为基线, 后续修复单独成 commit,便于区分与回退。 覆盖 oj 侧 65 个端点,新增 9 组路由(account/achievement/ai/classroom/ content/contest/flowchart/problemset/site)与对应 Zod 契约。 已核验:tsc --noEmit 退出码 0;API 可启动;/api/problems 返回真实数据; judge 与 flowchart worker 均 ready。 未核验:权限边界与数据泄露,评审进行中。 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
24 lines
673 B
TypeScript
24 lines
673 B
TypeScript
import { Queue } from "bullmq"
|
|
|
|
import { judgeQueueName, type JudgeJobData } from "./judge/job"
|
|
import { flowchartQueueName, type FlowchartJobData } from "./flowchart/job"
|
|
import { createBlockingRedis } from "./redis"
|
|
|
|
export const judgeQueue = new Queue<JudgeJobData>(judgeQueueName, {
|
|
connection: createBlockingRedis(),
|
|
defaultJobOptions: {
|
|
removeOnComplete: 100,
|
|
removeOnFail: 500,
|
|
},
|
|
})
|
|
|
|
export const flowchartQueue = new Queue<FlowchartJobData>(flowchartQueueName, {
|
|
connection: createBlockingRedis(),
|
|
defaultJobOptions: {
|
|
attempts: 3,
|
|
backoff: { type: "exponential", delay: 2_000 },
|
|
removeOnComplete: 100,
|
|
removeOnFail: 500,
|
|
},
|
|
})
|