Skip to content

Commit

Permalink
Refactor ConfigMetaDataChangedEventHandler (#29383)
Browse files Browse the repository at this point in the history
  • Loading branch information
terrymanu authored Dec 13, 2023
1 parent a5f007c commit cd56afb
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ public Pattern getKeyPattern() {
return PipelineMetaDataNode.CONFIG_PATTERN;
}

@SuppressWarnings("unchecked")
@Override
public void handle(final String jobId, final DataChangedEvent event) {
JobConfiguration jobConfig;
Expand All @@ -54,7 +55,7 @@ public void handle(final String jobId, final DataChangedEvent event) {
return;
}
log.info("{} job configuration: {}, disabled={}", event.getType(), event.getKey(), jobConfig.isDisabled());
TypedSPILoader.findService(JobConfigurationChangedProcessor.class, PipelineJobIdUtils.parseJobType(jobConfig.getJobName()).getType()).ifPresent(
optional -> new JobConfigurationChangedProcessEngine().process(event.getType(), jobConfig, optional));
String jobType = PipelineJobIdUtils.parseJobType(jobConfig.getJobName()).getType();
TypedSPILoader.findService(JobConfigurationChangedProcessor.class, jobType).ifPresent(optional -> new JobConfigurationChangedProcessEngine().process(event.getType(), jobConfig, optional));
}
}

0 comments on commit cd56afb

Please sign in to comment.