mirror of
https://github.com/MarginaliaSearch/MarginaliaSearch.git
synced 2025-02-24 13:19:02 +00:00

This is necessary as we use zookeeper to orchestrate first-time startup of the services, to ensure that the database is properly migrated by the control service before anything else is permitted to start.
42 lines
1.3 KiB
Java
42 lines
1.3 KiB
Java
package nu.marginalia.dating;
|
|
|
|
import com.google.inject.Guice;
|
|
import com.google.inject.Inject;
|
|
import com.google.inject.Injector;
|
|
import nu.marginalia.service.MainClass;
|
|
import nu.marginalia.service.discovery.ServiceRegistryIf;
|
|
import nu.marginalia.service.module.ServiceDiscoveryModule;
|
|
import nu.marginalia.service.ServiceId;
|
|
import nu.marginalia.service.module.ServiceConfigurationModule;
|
|
import nu.marginalia.service.module.DatabaseModule;
|
|
import nu.marginalia.service.server.Initialization;
|
|
import spark.Spark;
|
|
|
|
public class DatingMain extends MainClass {
|
|
final DatingService service;
|
|
|
|
@Inject
|
|
public DatingMain(DatingService service) {
|
|
this.service = service;
|
|
}
|
|
|
|
public static void main(String... args) {
|
|
init(ServiceId.Dating, args);
|
|
|
|
Spark.staticFileLocation("/static/dating/");
|
|
|
|
Injector injector = Guice.createInjector(
|
|
new DatingModule(),
|
|
new ServiceDiscoveryModule(),
|
|
new ServiceConfigurationModule(ServiceId.Dating),
|
|
new DatabaseModule(false)
|
|
);
|
|
|
|
// Ensure that the service registry is initialized early
|
|
injector.getInstance(ServiceRegistryIf.class);
|
|
|
|
injector.getInstance(DatingMain.class);
|
|
injector.getInstance(Initialization.class).setReady();
|
|
}
|
|
}
|