Skip to content

Commit

Permalink
changed maven index lookup tool serving port
Browse files Browse the repository at this point in the history
  • Loading branch information
Cornul11 committed Nov 23, 2023
1 parent 7aad775 commit fd26bad
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 13 deletions.
2 changes: 1 addition & 1 deletion util/api_benchmark.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def parse_jar_path(jar_path):
return groupId, artifactId, version


def benchmark_api(groupId, artifactId, version, url="http://localhost:8080/lookup"):
def benchmark_api(groupId, artifactId, version, url="http://localhost:8032/lookup"):
params = {
"groupId": groupId,
"artifactId": artifactId,
Expand Down
9 changes: 0 additions & 9 deletions util/maven-index-timestamp-lookup/run_app.sh
Original file line number Diff line number Diff line change
@@ -1,11 +1,2 @@
#!/bin/bash

INDEX_DIR="/app/target/central-index"
INDEX_MARKER="$INDEX_DIR/write.lock"

if [ ! -e "$INDEX_MARKER" ]; then
echo "Maven index not found or incomplete. Running update..."
java -cp "/app/maven-local-index-timestamp-lookup-7.0.3.jar:/app/libs/*" org.cornul11.maven.MavenIndexTimestampLookup update
fi

java -cp "/app/maven-local-index-timestamp-lookup-7.0.3.jar:/app/libs/*" org.cornul11.maven.MavenIndexTimestampLookup server
2 changes: 1 addition & 1 deletion util/maven-index-timestamp-lookup/run_server.sh
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
#!/usr/bin/bash
docker run -it --rm -v "$(pwd)/container-central-index:/app/target/central-index" -p 8080:8080 cornul11/maven-index:latest
docker run -it --rm -v "$(pwd)/container-central-index:/app/target/central-index" -p 8032:8032 cornul11/maven-index:latest
Original file line number Diff line number Diff line change
Expand Up @@ -171,8 +171,8 @@ private void executeQuery(IndexingContext context, Query query) throws IOExcepti
}
}

private void startServer(IndexingContext centralIndex) throws IOException {
port(8080);
private void startServer(IndexingContext centralIndex) {
port(8032);

get("/lookup", (request, response) -> {
String groupId = request.queryParams("groupId");
Expand Down Expand Up @@ -202,6 +202,7 @@ private void startServer(IndexingContext centralIndex) throws IOException {
// when the server is stopped, close the indexer
Runtime.getRuntime().addShutdownHook(new Thread(() -> {
try {
System.out.println("Shutting down...");
indexer.closeIndexingContext(centralIndex, false);
} catch (IOException e) {
e.printStackTrace();
Expand Down

0 comments on commit fd26bad

Please sign in to comment.