make update message entries await

This commit is contained in:
dal 2025-08-25 09:26:27 -06:00
parent 6c8e2ba03c
commit abbbd6eac7
No known key found for this signature in database
GPG Key ID: 16F4B0E1E9F61122
1 changed files with 4 additions and 7 deletions

View File

@ -78,14 +78,11 @@ export async function updateMessageEntries({
updateData.rawLlmMessages = mergedEntries.rawLlmMessages;
}
// Non-blocking DB update - don't await
db.update(messages)
// Update database for persistence
await db
.update(messages)
.set(updateData)
.where(and(eq(messages.id, messageId), isNull(messages.deletedAt)))
.catch((error) => {
// Log but don't fail - cache has the truth
console.error('Background DB update failed (cache still valid):', error);
});
.where(and(eq(messages.id, messageId), isNull(messages.deletedAt)));
return { success: true };
} catch (error) {