mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-12-23 03:40:14 +01:00
chore: error handling for complete omission of env var
This commit is contained in:
parent
277685c218
commit
5164cf46ac
4 changed files with 103 additions and 88 deletions
|
|
@ -53,12 +53,14 @@ const convoSchema = mongoose.Schema(
|
|||
{ timestamps: true }
|
||||
);
|
||||
|
||||
convoSchema.plugin(mongoMeili, {
|
||||
host: process.env.MEILI_HOST,
|
||||
apiKey: process.env.MEILI_KEY,
|
||||
indexName: 'convos', // Will get created automatically if it doesn't exist already
|
||||
primaryKey: 'conversationId'
|
||||
});
|
||||
if (process.env.MEILI_HOST && process.env.MEILI_KEY) {
|
||||
convoSchema.plugin(mongoMeili, {
|
||||
host: process.env.MEILI_HOST,
|
||||
apiKey: process.env.MEILI_KEY,
|
||||
indexName: 'convos', // Will get created automatically if it doesn't exist already
|
||||
primaryKey: 'conversationId'
|
||||
});
|
||||
}
|
||||
|
||||
const Conversation = mongoose.models.Conversation || mongoose.model('Conversation', convoSchema);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue