Skip to content

Commit

Permalink
docs(engine): document duplication
Browse files Browse the repository at this point in the history
It's important to highlight duplication, because if either changes, the
other should be changed as well.

(cherry picked from commit 25fae05)
  • Loading branch information
korthout committed Apr 28, 2022
1 parent 7b53544 commit 09dc18d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,8 @@ private void writeJobCanceled(final long jobKey) {

if (CANCELABLE_STATES.contains(state)) {
final JobRecord job = jobState.getJob(jobKey);
// Note that this logic is duplicated in JobCancelProcessor, if you change this please change
// it there as well.
stateWriter.appendFollowUpEvent(jobKey, JobIntent.CANCELED, job);
jobMetrics.jobCanceled(job.getType());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ public boolean onCommand(
final long jobKey = command.getKey();
final JobRecord job = jobState.getJob(jobKey);
if (job != null) {
// Note that this logic is duplicated in BpmnJobBehavior, if you change this please change
// it there as well.
commandControl.accept(JobIntent.CANCELED, job);
jobMetrics.jobCanceled(job.getType());
} else {
Expand Down

0 comments on commit 09dc18d

Please sign in to comment.