This is an automated email from the ASF dual-hosted git repository.

jsinovassinnaik pushed a commit to branch UNOMI-861-fix-wait
in repository https://gitbox.apache.org/repos/asf/unomi.git

commit 6b743c9796b7fcb52613a2a37573b0ec05aa01b5
Author: jsinovassin <[email protected]>
AuthorDate: Tue Oct 29 14:24:00 2024 +0100

    UNOMI-861: fix task check in migration"
---
 .../org/apache/unomi/shell/migration/utils/MigrationUtils.java     | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git 
a/tools/shell-commands/src/main/java/org/apache/unomi/shell/migration/utils/MigrationUtils.java
 
b/tools/shell-commands/src/main/java/org/apache/unomi/shell/migration/utils/MigrationUtils.java
index 69521c729..e08cbb733 100644
--- 
a/tools/shell-commands/src/main/java/org/apache/unomi/shell/migration/utils/MigrationUtils.java
+++ 
b/tools/shell-commands/src/main/java/org/apache/unomi/shell/migration/utils/MigrationUtils.java
@@ -335,7 +335,7 @@ public class MigrationUtils {
     public static void waitForTaskToFinish(CloseableHttpClient httpClient, 
String esAddress, String taskId, MigrationContext migrationContext) throws 
IOException {
         while (true) {
             final JSONObject status = new JSONObject(
-                    HttpUtils.executeGetRequest(httpClient, esAddress + 
"/_tasks/" + taskId + "?wait_for_completion=true&timeout=15s",
+                    HttpUtils.executeGetRequest(httpClient, esAddress + 
"/_tasks/" + taskId,
                             null));
             if (status.has("completed") && status.getBoolean("completed")) {
                 if (migrationContext != null) {
@@ -354,6 +354,11 @@ public class MigrationUtils {
             } else {
                 LOGGER.info("Waiting for Task {} to complete", taskId);
             }
+            try {
+                Thread.sleep(5000);
+            } catch (InterruptedException e) {
+                throw new RuntimeException(e);
+            }
         }
     }
 

Reply via email to