diff --git a/src/main/java/de/komoot/photon/App.java b/src/main/java/de/komoot/photon/App.java index dd347a121..8dc244673 100644 --- a/src/main/java/de/komoot/photon/App.java +++ b/src/main/java/de/komoot/photon/App.java @@ -52,6 +52,10 @@ public static void main(String[] rawArgs) throws Exception { try { Client esClient = esServer.getClient(); + log.info("Make sure that the ES cluster is ready, this might take some time."); + esClient.admin().cluster().prepareHealth().setWaitForGreenStatus().get(); + log.info("ES cluster is now ready."); + if (args.isRecreateIndex()) { shutdownES = true; startRecreatingIndex(esServer); @@ -66,9 +70,6 @@ public static void main(String[] rawArgs) throws Exception { if (args.isNominatimUpdate()) { shutdownES = true; - log.info("Ensuring that the cluster is ready, this might take some time."); - // inspired by https://stackoverflow.com/a/50316299 - esClient.admin().cluster().prepareHealth().setWaitForGreenStatus().execute().actionGet(); final NominatimUpdater nominatimUpdater = setupNominatimUpdater(args, esClient); nominatimUpdater.update(); return;