Add hooks so spam filters can register Dropwizard commands

This commit is contained in:
Jon Chambers
2025-11-21 12:37:05 -05:00
committed by Jon Chambers
parent 4d5cc4dc22
commit 1ce1c298d3
2 changed files with 17 additions and 0 deletions

View File

@@ -355,6 +355,12 @@ public class WhisperServerService extends Application<WhisperServerConfiguration
new IdleDeviceNotificationSchedulerFactory()));
bootstrap.addCommand(new RegenerateSecondaryDynamoDbTableDataCommand());
ServiceLoader.load(SpamFilter.class)
.stream()
.map(ServiceLoader.Provider::get)
.flatMap(spamFilter -> spamFilter.getCommands().stream())
.forEach(bootstrap::addCommand);
}
@Override