This is an automated email from the ASF dual-hosted git repository.
jsinovassinnaik pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/unomi.git
The following commit(s) were added to refs/heads/master by this push:
new 0ac13a44d UNOMI-861: fix task check in migration" (#705)
0ac13a44d is described below
commit 0ac13a44dbcea5310da49b8f1b4ffa7d96a49674
Author: jsinovassin <[email protected]>
AuthorDate: Tue Oct 29 16:41:11 2024 +0100
UNOMI-861: fix task check in migration" (#705)
---
.../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);
+ }
}
}