mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-12-16 16:30:15 +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
|
|
@ -6,6 +6,10 @@ const { MeiliSearch } = require('meilisearch');
|
|||
// eslint-disable-next-line no-unused-vars
|
||||
async function indexSync(req, res, next) {
|
||||
try {
|
||||
if (!process.env.MEILI_HOST || !process.env.MEILI_KEY || !process.env.SEARCH) {
|
||||
throw new Error('Meilisearch not configured, search will be disabled.');
|
||||
}
|
||||
|
||||
const client = new MeiliSearch({
|
||||
host: process.env.MEILI_HOST,
|
||||
apiKey: process.env.MEILI_KEY
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue