Browse Source

fix #2012 set maxEsStatusRetry to 60

Shinsuke Sugaya 6 years ago
parent
commit
07d88fd513
1 changed files with 4 additions and 2 deletions
  1. 4 2
      src/main/java/org/codelibs/fess/es/client/FessEsClient.java

+ 4 - 2
src/main/java/org/codelibs/fess/es/client/FessEsClient.java

@@ -183,7 +183,7 @@ public class FessEsClient implements Client {
 
     protected int maxConfigSyncStatusRetry = 10;
 
-    protected int maxEsStatusRetry = 10;
+    protected int maxEsStatusRetry = 60;
 
     protected String clusterName = "elasticsearch";
 
@@ -566,6 +566,7 @@ public class FessEsClient implements Client {
 
     protected void waitForYellowStatus(final FessConfig fessConfig) {
         Exception cause = null;
+        final long startTime = System.currentTimeMillis();
         for (int i = 0; i < maxEsStatusRetry; i++) {
             try {
                 final ClusterHealthResponse response =
@@ -589,7 +590,8 @@ public class FessEsClient implements Client {
         }
         final String message =
                 "Elasticsearch (" + System.getProperty(Constants.FESS_ES_HTTP_ADDRESS)
-                        + ") is not available. Check the state of your Elasticsearch cluster (" + clusterName + ").";
+                        + ") is not available. Check the state of your Elasticsearch cluster (" + clusterName + ") in "
+                        + (System.currentTimeMillis() - startTime) + "ms.";
         throw new ContainerInitFailureException(message, cause);
     }