mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-12-17 00:40:14 +01:00
chore: improve meili error handling
This commit is contained in:
parent
68979015c1
commit
655e7ce6d6
9 changed files with 182 additions and 64 deletions
|
|
@ -43,8 +43,21 @@ async function indexSync(req, res, next) {
|
|||
await Conversation.syncWithMeili();
|
||||
}
|
||||
} catch (err) {
|
||||
console.error(err);
|
||||
// res.status(500).json({ error: 'Server error' });
|
||||
// console.log('in index sync');
|
||||
if (err.message.includes('not found')) {
|
||||
console.log('Creating indices...');
|
||||
setTimeout(async () => {
|
||||
try {
|
||||
await Message.syncWithMeili();
|
||||
await Conversation.syncWithMeili();
|
||||
} catch (err) {
|
||||
console.error('Trouble creating indices, try restarting the server.');
|
||||
}
|
||||
}, 750);
|
||||
} else {
|
||||
console.error(err);
|
||||
// res.status(500).json({ error: 'Server error' });
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue