mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-12-17 17:00:15 +01:00
reduce noisy meili errors if not set
This commit is contained in:
parent
aacc292522
commit
1d464fdcfa
3 changed files with 11 additions and 6 deletions
|
|
@ -100,8 +100,8 @@ const createMeiliMongooseModel = function ({ index, indexName, client, attribute
|
||||||
// console.log('Adding document to Meili', object);
|
// console.log('Adding document to Meili', object);
|
||||||
await index.addDocuments([object]);
|
await index.addDocuments([object]);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.log('Error adding document to Meili');
|
// console.log('Error adding document to Meili');
|
||||||
console.error(error);
|
// console.error(error);
|
||||||
}
|
}
|
||||||
|
|
||||||
await this.collection.updateMany({ _id: this._id }, { $set: { _meiliIndex: true } });
|
await this.collection.updateMany({ _id: this._id }, { $set: { _meiliIndex: true } });
|
||||||
|
|
|
||||||
|
|
@ -81,10 +81,15 @@ const projectPath = path.join(__dirname, '..', '..', 'client');
|
||||||
|
|
||||||
let messageCount = 0;
|
let messageCount = 0;
|
||||||
process.on('uncaughtException', (err) => {
|
process.on('uncaughtException', (err) => {
|
||||||
console.error('There was an uncaught error:', err.message);
|
if (!err.message.includes('fetch failed')) {
|
||||||
|
console.error('There was an uncaught error:', err.message);
|
||||||
|
}
|
||||||
|
|
||||||
if (err.message.includes('fetch failed')) {
|
if (err.message.includes('fetch failed')) {
|
||||||
if (messageCount === 0) console.error('Meilisearch error, search will be disabled');
|
if (messageCount === 0) {
|
||||||
messageCount++;
|
console.error('Meilisearch error, search will be disabled');
|
||||||
|
messageCount++;
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
process.exit(1);
|
process.exit(1);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -110,7 +110,7 @@ router.get('/enable', async function (req, res) {
|
||||||
result = status === 'available' && !!process.env.SEARCH;
|
result = status === 'available' && !!process.env.SEARCH;
|
||||||
return res.send(result);
|
return res.send(result);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error(error);
|
// console.error(error);
|
||||||
return res.send(false);
|
return res.send(false);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue