From b62b7203e100b55d79e75b819a48b471c1f4c350 Mon Sep 17 00:00:00 2001 From: Mike <45373284+munkhuushmgl@users.noreply.github.com> Date: Wed, 26 Aug 2020 15:36:21 -0700 Subject: [PATCH] fix: increase batch translate timeout to 300 (#274) --- .../src/main/java/com/example/translate/BatchTranslateText.java | 2 +- .../com/example/translate/BatchTranslateTextWithGlossary.java | 2 +- .../translate/BatchTranslateTextWithGlossaryAndModel.java | 2 +- .../java/com/example/translate/BatchTranslateTextWithModel.java | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/translate/snippets/src/main/java/com/example/translate/BatchTranslateText.java b/translate/snippets/src/main/java/com/example/translate/BatchTranslateText.java index 118cf6bff97..690525258c4 100644 --- a/translate/snippets/src/main/java/com/example/translate/BatchTranslateText.java +++ b/translate/snippets/src/main/java/com/example/translate/BatchTranslateText.java @@ -85,7 +85,7 @@ public static void batchTranslateText( client.batchTranslateTextAsync(request); System.out.println("Waiting for operation to complete..."); - BatchTranslateResponse response = future.get(180, TimeUnit.SECONDS); + BatchTranslateResponse response = future.get(300, TimeUnit.SECONDS); System.out.printf("Total Characters: %s\n", response.getTotalCharacters()); System.out.printf("Translated Characters: %s\n", response.getTranslatedCharacters()); } diff --git a/translate/snippets/src/main/java/com/example/translate/BatchTranslateTextWithGlossary.java b/translate/snippets/src/main/java/com/example/translate/BatchTranslateTextWithGlossary.java index a839d500ac4..21780b74249 100644 --- a/translate/snippets/src/main/java/com/example/translate/BatchTranslateTextWithGlossary.java +++ b/translate/snippets/src/main/java/com/example/translate/BatchTranslateTextWithGlossary.java @@ -103,7 +103,7 @@ public static void batchTranslateTextWithGlossary( client.batchTranslateTextAsync(request); System.out.println("Waiting for operation to complete..."); - BatchTranslateResponse response = future.get(180, TimeUnit.SECONDS); + BatchTranslateResponse response = future.get(300, TimeUnit.SECONDS); // Display the translation for each input text provided System.out.printf("Total Characters: %s\n", response.getTotalCharacters()); System.out.printf("Translated Characters: %s\n", response.getTranslatedCharacters()); diff --git a/translate/snippets/src/main/java/com/example/translate/BatchTranslateTextWithGlossaryAndModel.java b/translate/snippets/src/main/java/com/example/translate/BatchTranslateTextWithGlossaryAndModel.java index 92615eb1b4c..652709091ff 100644 --- a/translate/snippets/src/main/java/com/example/translate/BatchTranslateTextWithGlossaryAndModel.java +++ b/translate/snippets/src/main/java/com/example/translate/BatchTranslateTextWithGlossaryAndModel.java @@ -110,7 +110,7 @@ public static void batchTranslateTextWithGlossaryAndModel( client.batchTranslateTextAsync(request); System.out.println("Waiting for operation to complete..."); - BatchTranslateResponse response = future.get(180, TimeUnit.SECONDS); + BatchTranslateResponse response = future.get(300, TimeUnit.SECONDS); // Display the translation for each input text provided System.out.printf("Total Characters: %s\n", response.getTotalCharacters()); System.out.printf("Translated Characters: %s\n", response.getTranslatedCharacters()); diff --git a/translate/snippets/src/main/java/com/example/translate/BatchTranslateTextWithModel.java b/translate/snippets/src/main/java/com/example/translate/BatchTranslateTextWithModel.java index acce714753a..2232724c7ba 100644 --- a/translate/snippets/src/main/java/com/example/translate/BatchTranslateTextWithModel.java +++ b/translate/snippets/src/main/java/com/example/translate/BatchTranslateTextWithModel.java @@ -100,7 +100,7 @@ public static void batchTranslateTextWithModel( client.batchTranslateTextAsync(request); System.out.println("Waiting for operation to complete..."); - BatchTranslateResponse response = future.get(180, TimeUnit.SECONDS); + BatchTranslateResponse response = future.get(300, TimeUnit.SECONDS); // Display the translation for each input text provided System.out.printf("Total Characters: %s\n", response.getTotalCharacters()); System.out.printf("Translated Characters: %s\n", response.getTranslatedCharacters());