From 2ae57a5ce84432ec0070f5fb957bee410adb8064 Mon Sep 17 00:00:00 2001 From: Mike <45373284+munkhuushmgl@users.noreply.github.com> Date: Tue, 22 Sep 2020 12:43:46 -0700 Subject: [PATCH] samples: increased timeout up to 450 secs since batch LRO reaches 5 min mark sometimes (#286) --- .../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 690525258c4..3f547a9db73 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(300, TimeUnit.SECONDS); + BatchTranslateResponse response = future.get(450, 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 21780b74249..8b270bb68d7 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(300, TimeUnit.SECONDS); + BatchTranslateResponse response = future.get(450, 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 652709091ff..8ecab29c8a1 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(300, TimeUnit.SECONDS); + BatchTranslateResponse response = future.get(450, 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 2232724c7ba..c8c906619ac 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(300, TimeUnit.SECONDS); + BatchTranslateResponse response = future.get(450, 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());