Skip to content

Commit 1a8636c

Browse files
committed
feat: enable phase create/update handlers
1 parent 5e6d705 commit 1a8636c

File tree

1 file changed

+4
-16
lines changed

1 file changed

+4
-16
lines changed

src/services/ProcessorServicePhase.js

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -66,14 +66,8 @@ async function create (message) {
6666
return _.assign(doc._source, { phases })
6767
}
6868

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

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

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

11098
update.schema = {

0 commit comments

Comments
 (0)