Skip to content

Commit

Permalink
Refactor DatabaseMetaDataChangedListener (#34061)
Browse files Browse the repository at this point in the history
  • Loading branch information
terrymanu authored Dec 14, 2024
1 parent d9f70bd commit 2c9996e
Showing 1 changed file with 2 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,6 @@
@RequiredArgsConstructor
public final class DatabaseMetaDataChangedListener implements DataChangedEventListener {

private final MetaDataChangedEventBuilder metaDataChangedEventBuilder = new MetaDataChangedEventBuilder();

private final RuleConfigurationChangedEventBuilder ruleConfigChangedEventBuilder = new RuleConfigurationChangedEventBuilder();

private final EventBusContext eventBusContext;

@Override
Expand All @@ -51,7 +47,7 @@ private Optional<DispatchEvent> createDispatchEvent(final DataChangedEvent event
if (!databaseName.isPresent()) {
return Optional.empty();
}
Optional<DispatchEvent> metaDataChangedEvent = metaDataChangedEventBuilder.build(databaseName.get(), event);
return metaDataChangedEvent.isPresent() ? metaDataChangedEvent : ruleConfigChangedEventBuilder.build(databaseName.get(), event);
Optional<DispatchEvent> metaDataChangedEvent = new MetaDataChangedEventBuilder().build(databaseName.get(), event);
return metaDataChangedEvent.isPresent() ? metaDataChangedEvent : new RuleConfigurationChangedEventBuilder().build(databaseName.get(), event);
}
}

0 comments on commit 2c9996e

Please sign in to comment.