(refac) Remove "distPath"
This commit is contained in:
parent
f4ff7185f0
commit
6154e16951
@ -1,15 +1,8 @@
|
|||||||
package nu.marginalia.executor;
|
package nu.marginalia.executor;
|
||||||
|
|
||||||
import com.google.inject.AbstractModule;
|
import com.google.inject.AbstractModule;
|
||||||
import com.google.inject.name.Names;
|
|
||||||
import nu.marginalia.WmsaHome;
|
|
||||||
|
|
||||||
import java.nio.file.Path;
|
|
||||||
|
|
||||||
public class ExecutorModule extends AbstractModule {
|
public class ExecutorModule extends AbstractModule {
|
||||||
public void configure() {
|
public void configure() {
|
||||||
|
|
||||||
String dist = System.getProperty("distPath", WmsaHome.getHomePath().resolve("/dist").toString());
|
|
||||||
bind(Path.class).annotatedWith(Names.named("distPath")).toInstance(Path.of(dist));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2,14 +2,12 @@ package nu.marginalia.process;
|
|||||||
|
|
||||||
import com.google.inject.Inject;
|
import com.google.inject.Inject;
|
||||||
import com.google.inject.Singleton;
|
import com.google.inject.Singleton;
|
||||||
import com.google.inject.name.Named;
|
|
||||||
import nu.marginalia.WmsaHome;
|
import nu.marginalia.WmsaHome;
|
||||||
import nu.marginalia.adjacencies.WebsiteAdjacenciesCalculator;
|
import nu.marginalia.adjacencies.WebsiteAdjacenciesCalculator;
|
||||||
import nu.marginalia.converting.ConverterMain;
|
import nu.marginalia.converting.ConverterMain;
|
||||||
import nu.marginalia.crawl.CrawlerMain;
|
import nu.marginalia.crawl.CrawlerMain;
|
||||||
import nu.marginalia.index.IndexConstructorMain;
|
import nu.marginalia.index.IndexConstructorMain;
|
||||||
import nu.marginalia.loading.LoaderMain;
|
import nu.marginalia.loading.LoaderMain;
|
||||||
import nu.marginalia.service.MainClass;
|
|
||||||
import nu.marginalia.service.ProcessMainClass;
|
import nu.marginalia.service.ProcessMainClass;
|
||||||
import nu.marginalia.service.control.ServiceEventLog;
|
import nu.marginalia.service.control.ServiceEventLog;
|
||||||
import nu.marginalia.service.server.BaseServiceParams;
|
import nu.marginalia.service.server.BaseServiceParams;
|
||||||
@ -21,8 +19,6 @@ import org.slf4j.MarkerFactory;
|
|||||||
import java.io.BufferedReader;
|
import java.io.BufferedReader;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.InputStreamReader;
|
import java.io.InputStreamReader;
|
||||||
import java.nio.file.Files;
|
|
||||||
import java.nio.file.Path;
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@ -34,7 +30,6 @@ public class ProcessService {
|
|||||||
private final Marker processMarker = MarkerFactory.getMarker("PROCESS");
|
private final Marker processMarker = MarkerFactory.getMarker("PROCESS");
|
||||||
|
|
||||||
private final ServiceEventLog eventLog;
|
private final ServiceEventLog eventLog;
|
||||||
private final Path distPath;
|
|
||||||
|
|
||||||
private final ConcurrentHashMap<ProcessId, Process> processes = new ConcurrentHashMap<>();
|
private final ConcurrentHashMap<ProcessId, Process> processes = new ConcurrentHashMap<>();
|
||||||
|
|
||||||
@ -81,10 +76,8 @@ public class ProcessService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
public ProcessService(BaseServiceParams params,
|
public ProcessService(BaseServiceParams params) {
|
||||||
@Named("distPath") Path distPath) {
|
|
||||||
this.eventLog = params.eventLog;
|
this.eventLog = params.eventLog;
|
||||||
this.distPath = distPath;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
2
run/env/service.env
vendored
2
run/env/service.env
vendored
@ -1,7 +1,7 @@
|
|||||||
WMSA_HOME=run/
|
WMSA_HOME=run/
|
||||||
JAVA_OPTS="--enable-preview -da -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=4000 -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false"
|
JAVA_OPTS="--enable-preview -da -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=4000 -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false"
|
||||||
JAVA_TOOL_OPTIONS="--enable-preview -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=*:5000"
|
JAVA_TOOL_OPTIONS="--enable-preview -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=*:5000"
|
||||||
EXECUTOR_SERVICE_OPTS="-DdistPath=/dist"
|
EXECUTOR_SERVICE_OPTS=""
|
||||||
CONVERTER_PROCESS_OPTS="-Dservice-name=converter"
|
CONVERTER_PROCESS_OPTS="-Dservice-name=converter"
|
||||||
CRAWLER_PROCESS_OPTS="-Dservice-name=crawler"
|
CRAWLER_PROCESS_OPTS="-Dservice-name=crawler"
|
||||||
LOADER_PROCESS_OPTS="-Dservice-name=loader"
|
LOADER_PROCESS_OPTS="-Dservice-name=loader"
|
||||||
|
Loading…
Reference in New Issue
Block a user