Merge branch 'pr/538'
This commit is contained in:
commit
0f6b3c2e69
1 changed files with 2 additions and 2 deletions
|
@ -5,7 +5,7 @@ import type { Embeddings } from '@langchain/core/embeddings';
|
||||||
import logger from '../utils/logger';
|
import logger from '../utils/logger';
|
||||||
import db from '../db';
|
import db from '../db';
|
||||||
import { chats, messages as messagesSchema } from '../db/schema';
|
import { chats, messages as messagesSchema } from '../db/schema';
|
||||||
import { eq, asc, gt } from 'drizzle-orm';
|
import { eq, asc, gt, and } from 'drizzle-orm';
|
||||||
import crypto from 'crypto';
|
import crypto from 'crypto';
|
||||||
import { getFileDetails } from '../utils/files';
|
import { getFileDetails } from '../utils/files';
|
||||||
import MetaSearchAgent, {
|
import MetaSearchAgent, {
|
||||||
|
@ -238,7 +238,7 @@ export const handleMessage = async (
|
||||||
} else {
|
} else {
|
||||||
await db
|
await db
|
||||||
.delete(messagesSchema)
|
.delete(messagesSchema)
|
||||||
.where(gt(messagesSchema.id, messageExists.id))
|
.where(and(gt(messagesSchema.id, messageExists.id), eq(messagesSchema.chatId, parsedMessage.chatId)))
|
||||||
.execute();
|
.execute();
|
||||||
}
|
}
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue