diff --git a/src/events/projects/index.js b/src/events/projects/index.js index f11f474f..ce5a1cec 100644 --- a/src/events/projects/index.js +++ b/src/events/projects/index.js @@ -172,7 +172,9 @@ async function projectUpdatedKafkaHandler(app, topic, payload) { // first get the existing document and than merge the updated changes and save the new document try { const doc = await eClient.get({ index: ES_PROJECT_INDEX, type: ES_PROJECT_TYPE, id: previousValue.id }); + console.log(doc._source, 'Received project from ES');// eslint-disable-line no-underscore-dangle const merged = _.merge(doc._source, project.get({ plain: true })); // eslint-disable-line no-underscore-dangle + console.log(merged, 'Merged project'); // update the merged document await eClient.update({ index: ES_PROJECT_INDEX, @@ -182,6 +184,7 @@ async function projectUpdatedKafkaHandler(app, topic, payload) { doc: merged, }, }); + console.log(`Succesfully updated project document in ES (projectId: ${previousValue.id})`); } catch (error) { throw Error(`failed to updated project document in elasitcsearch index (projectId: ${previousValue.id})` + `. Details: '${error}'.`);