Skip to content

feat: enable phase create/update handlers #50

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 1 commit into from
Oct 23, 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
20 changes: 4 additions & 16 deletions src/services/ProcessorServicePhase.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,14 +66,8 @@ async function create (message) {
return _.assign(doc._source, { phases })
}

// NOTE Disable indexing phases when create at the moment, as it's now being indexed inside Project Service.
// It's because adding a phase may cause cascading updates of other phases and in such cases we are doing
// one ES index call instead of multiple calls. Otherwise ES may fail with error `version conflict`.
// This would be turned on back, as soon as we get rid of such cascading updates inside Project Service.
//
// await helper.updateProjectESPromise(message.projectId, updateDocPromise)
// logger.debug(`Project phase created successfully in elasticsearch index, (projectPhaseId: ${message.id})`)
logger.debug(`TEMPORARY SKIPPED: Project phase created successfully in elasticsearch index, (projectPhaseId: ${message.id})`)
await helper.updateProjectESPromise(message.projectId, updateDocPromise)
logger.debug(`Project phase created successfully in elasticsearch index, (projectPhaseId: ${message.id})`)
}

create.schema = {
Expand All @@ -97,14 +91,8 @@ async function update (message) {
return _.assign(doc._source, { phases })
}

// NOTE Disable indexing phases when update at the moment, as it's now being indexed inside Project Service.
// It's because updating a phase may cause cascading updates of other phases and in such cases we are doing
// one ES index call instead of multiple calls. Otherwise ES may fail with error `version conflict`.
// This would be turned on back, as soon as we get rid of such cascading updates inside Project Service.
//
// await helper.updateProjectESPromise(message.projectId, updateDocPromise)
// logger.debug(`Project phase updated successfully in elasticsearch index, (projectPhaseId: ${message.id})`)
logger.debug(`TEMPORARY SKIPPED: Project phase updated successfully in elasticsearch index, (projectPhaseId: ${message.id})`)
await helper.updateProjectESPromise(message.projectId, updateDocPromise)
logger.debug(`Project phase updated successfully in elasticsearch index, (projectPhaseId: ${message.id})`)
}

update.schema = {
Expand Down