You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@unomi.apache.org by js...@apache.org on 2024/10/29 13:24:40 UTC

(unomi) branch UNOMI-861-fix-wait created (now 6b743c979)

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

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


      at 6b743c979 UNOMI-861: fix task check in migration"

This branch includes the following new commits:

     new 6b743c979 UNOMI-861: fix task check in migration"

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



(unomi) 01/01: UNOMI-861: fix task check in migration"

Posted by js...@apache.org.
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 <js...@jahia.com>
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);
+            }
         }
     }