Skip to content

Hotfix/additional logs for team updated event #511

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Mar 20, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/events/projects/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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}'.`);
Expand Down