fix: increase max active requests and adjust debounce timing for conversation analysis

This commit is contained in:
MythEclipse
2026-05-18 06:04:30 +07:00
parent a037d17f53
commit 69ba7b497f
2 changed files with 26 additions and 3 deletions
+15 -1
View File
@@ -5,7 +5,10 @@ import {
getAnalysisQueueStatus,
queueMessageAnalysis,
} from "../moderation/aiAnalyzer";
import { getMessageById } from "../moderation/messageStore";
import {
getMessageById,
updateMessageAIAnalysis,
} from "../moderation/messageStore";
export function createAnalysisRoutes(): Router {
const router = express.Router();
@@ -35,6 +38,17 @@ export function createAnalysisRoutes(): Router {
throw new AppError("Message not found", "MESSAGE_NOT_FOUND", 404);
}
// Reset analysis status to pending so it gets picked up by the analyzer
await updateMessageAIAnalysis(id, {
status: "pending",
flags: null,
score: null,
raw: null,
analysis: null,
analyzedAt: null,
error: null,
});
// Queue for analysis
await queueMessageAnalysis(id);