fix: reanalyze edited messages
This commit is contained in:
@@ -117,7 +117,7 @@ async function processBatch(
|
||||
|
||||
// Broadcast analyzed messages
|
||||
for (const row of analyzedRows) {
|
||||
(globalThis as any).broadcastMessageAnalyzed?.(row);
|
||||
(globalThis as any).moderationBroadcaster?.messageAnalyzed(row);
|
||||
}
|
||||
|
||||
// Clear error cooldown on success
|
||||
@@ -147,7 +147,7 @@ async function processBatch(
|
||||
error: lastError,
|
||||
});
|
||||
if (row) {
|
||||
(globalThis as any).broadcastMessageAnalyzed?.(row);
|
||||
(globalThis as any).moderationBroadcaster?.messageAnalyzed(row);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -102,6 +102,13 @@ export async function updateMessageAsEdited(
|
||||
edited_content: editedContent,
|
||||
edited_at: editedAt,
|
||||
type: "edited",
|
||||
ai_status: "pending",
|
||||
ai_moderation_flags: null,
|
||||
ai_moderation_score: null,
|
||||
ai_moderation_raw: null,
|
||||
ai_analysis: null,
|
||||
ai_analyzed_at: null,
|
||||
ai_error: null,
|
||||
})
|
||||
.where(eq(messagesTable.id, messageId));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user