refactor(ai-moderation): unify worker pool entry points with discriminated union routing

This commit is contained in:
MythEclipse
2026-06-04 17:39:40 +07:00
parent 686dc2de4f
commit 4996acfacf
2 changed files with 138 additions and 176 deletions
@@ -412,7 +412,7 @@ async function processIndividualFallback(
);
const simpleResult = await workerPool.run({
type: "individual_simple",
type: "individual",
message,
skipNormalAnalysis: true,
} as any) as
@@ -654,6 +654,7 @@ async function processBatch(
conversationProcessing.set(conversationKey, processingStartedAt);
try {
const result = (await workerPool.run({
type: "batch",
conversationKey,
messages,
})) as AnalysisWorkerResponse;