0
0
mirror of https://github.com/signalapp/Signal-Server.git synced 2024-09-20 12:02:18 +02:00

Make command namespace available to subclasses

This commit is contained in:
Jon Chambers 2023-10-04 16:42:04 -04:00 committed by Jon Chambers
parent 0100f0fcc9
commit 6fd1c84126

View File

@ -24,6 +24,7 @@ import reactor.core.scheduler.Schedulers;
public abstract class AbstractSinglePassCrawlAccountsCommand extends EnvironmentCommand<WhisperServerConfiguration> { public abstract class AbstractSinglePassCrawlAccountsCommand extends EnvironmentCommand<WhisperServerConfiguration> {
private CommandDependencies commandDependencies; private CommandDependencies commandDependencies;
private Namespace namespace;
private final Logger logger = LoggerFactory.getLogger(getClass()); private final Logger logger = LoggerFactory.getLogger(getClass());
@ -53,14 +54,19 @@ public abstract class AbstractSinglePassCrawlAccountsCommand extends Environment
return commandDependencies; return commandDependencies;
} }
protected Namespace getNamespace() {
return namespace;
}
@Override @Override
protected void run(final Environment environment, final Namespace namespace, protected void run(final Environment environment, final Namespace namespace,
final WhisperServerConfiguration configuration) throws Exception { final WhisperServerConfiguration configuration) throws Exception {
UncaughtExceptionHandler.register(); UncaughtExceptionHandler.register();
MetricsUtil.configureRegistries(configuration, environment); MetricsUtil.configureRegistries(configuration, environment);
commandDependencies = CommandDependencies.build(getName(), environment, configuration);
this.namespace = namespace;
this.commandDependencies = CommandDependencies.build(getName(), environment, configuration);
final int segments = Objects.requireNonNull(namespace.getInt(SEGMENT_COUNT)); final int segments = Objects.requireNonNull(namespace.getInt(SEGMENT_COUNT));
@ -75,7 +81,6 @@ public abstract class AbstractSinglePassCrawlAccountsCommand extends Environment
} finally { } finally {
commandStopListener.stop(); commandStopListener.stop();
} }
} }
@Override @Override