1
1
mirror of https://github.com/MarginaliaSearch/MarginaliaSearch.git synced 2025-10-05 21:22:39 +02:00

(cleanup) Clean up code

This commit is contained in:
Viktor Lofgren
2024-02-20 14:17:18 +01:00
parent 07b625c58d
commit 36a5c8b44c
3 changed files with 6 additions and 27 deletions

View File

@@ -79,7 +79,7 @@ public class ZkServiceRegistry implements ServiceRegistryIf {
}
}
logger.info("Registering {} -> {}", path, instanceUUID);
logger.info("Registering {} -> {}", path, endpoint);
ephemeralProperty.forPath(path, payload);

View File

@@ -1,13 +1,8 @@
package nu.marginalia.query;
import com.google.gson.Gson;
import com.google.inject.Inject;
import io.prometheus.client.Histogram;
import lombok.SneakyThrows;
import nu.marginalia.db.DomainBlacklist;
import nu.marginalia.index.client.IndexClient;
import nu.marginalia.query.svc.QueryFactory;
import nu.marginalia.service.NodeConfigurationWatcher;
import nu.marginalia.service.server.BaseServiceParams;
import nu.marginalia.service.server.Service;
import spark.Spark;
@@ -17,12 +12,6 @@ import java.util.List;
public class QueryService extends Service {
private final IndexClient indexClient;
private final NodeConfigurationWatcher nodeWatcher;
private final Gson gson;
private final DomainBlacklist blacklist;
private final QueryFactory queryFactory;
private static final Histogram wmsa_qs_query_time_rest = Histogram.build()
.name("wmsa_qs_query_time_rest")
.linearBuckets(0.05, 0.05, 15)
@@ -33,24 +22,14 @@ public class QueryService extends Service {
@SneakyThrows
@Inject
public QueryService(BaseServiceParams params,
IndexClient indexClient,
NodeConfigurationWatcher nodeWatcher,
QueryGRPCDomainLinksService domainLinksService,
QueryGRPCService queryGRPCService,
Gson gson,
DomainBlacklist blacklist,
QueryBasicInterface queryBasicInterface,
QueryFactory queryFactory)
QueryBasicInterface queryBasicInterface)
{
super(params,
() -> Spark.staticFileLocation("/static/"),
List.of(queryGRPCService, domainLinksService));
this.indexClient = indexClient;
this.nodeWatcher = nodeWatcher;
this.gson = gson;
this.blacklist = blacklist;
this.queryFactory = queryFactory;
Spark.get("/public/search", queryBasicInterface::handle);

8
run/env/service.env vendored
View File

@@ -1,8 +1,8 @@
WMSA_HOME=run/
JAVA_OPTS="--enable-preview -da -Dservice-host=0.0.0.0 -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 -Dservice.bind-address=0.0.0.0 -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"
EXECUTOR_SERVICE_OPTS="-DdistPath=/dist"
CONVERTER_PROCESS_OPTS="-Dservice-name=converter -Dservice-host=0.0.0.0"
CRAWLER_PROCESS_OPTS="-Dservice-name=crawler -Dservice-host=0.0.0.0"
LOADER_PROCESS_OPTS="-Dservice-name=loader -Dservice-host=0.0.0.0"
CONVERTER_PROCESS_OPTS="-Dservice-name=converter"
CRAWLER_PROCESS_OPTS="-Dservice-name=crawler"
LOADER_PROCESS_OPTS="-Dservice-name=loader"
INDEX_CONSTRUCTION_PROCESS_OPTS="-Dservice-name=index-constructor -Djava.util.concurrent.ForkJoinPool.common.parallelism=4"