mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-12-20 02:10:15 +01:00
refactor: original changes
This commit is contained in:
parent
fa9177180f
commit
f9c0e9853f
83 changed files with 413 additions and 505 deletions
|
|
@ -1,7 +1,6 @@
|
|||
const { MeiliSearch } = require('meilisearch');
|
||||
const { Message, Conversation, logger } = require('@librechat/data-schemas');
|
||||
const { isEnabled } = require('~/server/utils');
|
||||
const { logger } = require('~/config');
|
||||
const db = require('~/lib/db/connectDb');
|
||||
|
||||
const searchEnabled = isEnabled(process.env.SEARCH);
|
||||
const indexingDisabled = isEnabled(process.env.MEILI_NO_SYNC);
|
||||
|
|
@ -28,7 +27,6 @@ async function indexSync() {
|
|||
if (!searchEnabled) {
|
||||
return;
|
||||
}
|
||||
const { Message, Conversation } = db.models;
|
||||
try {
|
||||
const client = MeiliSearchClient.getInstance();
|
||||
|
||||
|
|
@ -42,6 +40,8 @@ async function indexSync() {
|
|||
return;
|
||||
}
|
||||
|
||||
logger.info('[indexSync] Starting index sync...');
|
||||
|
||||
const messageCount = await Message.countDocuments();
|
||||
const convoCount = await Conversation.countDocuments();
|
||||
const messages = await client.index('messages').getStats();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue