Skip to content

Commit 009a228

Browse files
telpiriongcf-owl-bot[bot]
authored andcommitted
fix: extend timeout on batch translation requests (#775)
* fix: extend timeout on batch translation requests * 🦉 Updates from OwlBot See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * 🦉 Updates from OwlBot See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
1 parent 9110ecf commit 009a228

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

translate/snippets/src/main/java/com/example/translate/BatchTranslateText.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ public static void batchTranslateText(
8888
System.out.println("Waiting for operation to complete...");
8989

9090
// random number between 300 - 450 (maximum allowed seconds)
91-
long randomNumber = ThreadLocalRandom.current().nextInt(300, 450);
91+
long randomNumber = ThreadLocalRandom.current().nextInt(450, 600);
9292
BatchTranslateResponse response = future.get(randomNumber, TimeUnit.SECONDS);
9393

9494
System.out.printf("Total Characters: %s\n", response.getTotalCharacters());

translate/snippets/src/main/java/com/example/translate/BatchTranslateTextWithGlossary.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ public static void batchTranslateTextWithGlossary(
106106
System.out.println("Waiting for operation to complete...");
107107

108108
// random number between 300 - 450 (maximum allowed seconds)
109-
long randomNumber = ThreadLocalRandom.current().nextInt(300, 450);
109+
long randomNumber = ThreadLocalRandom.current().nextInt(450, 600);
110110
BatchTranslateResponse response = future.get(randomNumber, TimeUnit.SECONDS);
111111

112112
// Display the translation for each input text provided

translate/snippets/src/main/java/com/example/translate/BatchTranslateTextWithGlossaryAndModel.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ public static void batchTranslateTextWithGlossaryAndModel(
113113
System.out.println("Waiting for operation to complete...");
114114

115115
// random number between 300 - 450 (maximum allowed seconds)
116-
long randomNumber = ThreadLocalRandom.current().nextInt(300, 450);
116+
long randomNumber = ThreadLocalRandom.current().nextInt(450, 600);
117117
BatchTranslateResponse response = future.get(randomNumber, TimeUnit.SECONDS);
118118

119119
// Display the translation for each input text provided

translate/snippets/src/main/java/com/example/translate/BatchTranslateTextWithModel.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ public static void batchTranslateTextWithModel(
103103
System.out.println("Waiting for operation to complete...");
104104

105105
// random number between 300 - 450 (maximum allowed seconds)
106-
long randomNumber = ThreadLocalRandom.current().nextInt(300, 450);
106+
long randomNumber = ThreadLocalRandom.current().nextInt(450, 600);
107107
BatchTranslateResponse response = future.get(randomNumber, TimeUnit.SECONDS);
108108

109109
// Display the translation for each input text provided

0 commit comments

Comments
 (0)