Skip to content

Commit

Permalink
Sync mailisearch index after import
Browse files Browse the repository at this point in the history
  • Loading branch information
DenisPalnitsky committed Apr 19, 2024
1 parent ae10a4d commit 737d9f2
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions api/server/utils/import/jobDefinition.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
const { getImporter } = require('./importers');
const { logger } = require('~/config');
const jobScheduler = require('~/server/utils/jobScheduler');
const { indexSync } = require('~/lib/db');

const IMPORT_CONVERSATION_JOB_NAME = 'import conversation';

Expand All @@ -14,6 +15,8 @@ const importConversationJob = async (job, done) => {
const jsonData = JSON.parse(data);
const importer = getImporter(jsonData);
await importer(jsonData, requestUserId);
//sync meilisearch index
await indexSync();
logger.info('Finished importing conversations');
done();
} catch (error) {
Expand Down

0 comments on commit 737d9f2

Please sign in to comment.