fix(mongoMeili): allow convo deletion if meili errors or disabled (#609)

This commit is contained in:
Danny Avila 2023-07-08 11:41:51 -04:00 committed by GitHub
parent f0e2639269
commit ce6490109f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 17 additions and 4 deletions

View file

@ -6,8 +6,9 @@ let currentTimeout = null;
// eslint-disable-next-line no-unused-vars
async function indexSync(req, res, next) {
const searchEnabled = process.env.SEARCH && process.env.SEARCH.toLowerCase() === 'true';
try {
if (!process.env.MEILI_HOST || !process.env.MEILI_MASTER_KEY || !process.env.SEARCH) {
if (!process.env.MEILI_HOST || !process.env.MEILI_MASTER_KEY || !searchEnabled) {
throw new Error('Meilisearch not configured, search will be disabled.');
}