Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions src/main/java/de/komoot/photon/App.java
Original file line number Diff line number Diff line change
Expand Up @@ -484,12 +484,13 @@ private static void startApi(ApiServerConfig args, Server server, @Nullable Nomi
throw new UsageException("Update API enabled, but Nominatim database is not prepared. Run -nominatim-update-init-for first.");
}

// Tiny pitfall in javalin: strings are treated as being json already by json().
config.routes.get("/nominatim-update/status", ctx ->
ctx.status(200).json(updater.isBusy() ? "BUSY" : "OK")
ctx.status(200).json('"' + (updater.isBusy() ? "BUSY" : "OK") + '"')
);
config.routes.get("/nominatim-update", ctx -> {
new Thread(() -> App.startNominatimUpdate(updater, server)).start();
ctx.status(200).json("nominatim update started (more information in console output) ...");
ctx.status(200).json("\"nominatim update started (more information in console output) ...\"");
});
}

Expand Down
Loading