From 1f9f03a4ab7ebaeec583699c11d43427a9703eeb Mon Sep 17 00:00:00 2001 From: Mike <45373284+munkhuushmgl@users.noreply.github.com> Date: Mon, 28 Dec 2020 17:49:06 -0800 Subject: [PATCH] docs: increase timeout on batch (#609) --- translate/v3/translate_batch_translate_text.js | 6 +++++- .../v3/translate_batch_translate_text_with_glossary.js | 3 ++- ...ranslate_batch_translate_text_with_glossary_and_model.js | 3 ++- translate/v3/translate_batch_translate_text_with_model.js | 3 ++- 4 files changed, 11 insertions(+), 4 deletions(-) diff --git a/translate/v3/translate_batch_translate_text.js b/translate/v3/translate_batch_translate_text.js index 4a81e988673..c6107327ad3 100644 --- a/translate/v3/translate_batch_translate_text.js +++ b/translate/v3/translate_batch_translate_text.js @@ -56,8 +56,12 @@ function main( }; try { + const options = {timeout: 180000}; // Batch translate text using a long-running operation - const [operation] = await translationClient.batchTranslateText(request); + const [operation] = await translationClient.batchTranslateText( + request, + options + ); // Wait for operation to complete. const [response] = await operation.promise(); diff --git a/translate/v3/translate_batch_translate_text_with_glossary.js b/translate/v3/translate_batch_translate_text_with_glossary.js index e34589b2493..2bfeb2888e5 100644 --- a/translate/v3/translate_batch_translate_text_with_glossary.js +++ b/translate/v3/translate_batch_translate_text_with_glossary.js @@ -63,8 +63,9 @@ function main( }; try { + const options = {timeout: 180000}; // Create a job using a long-running operation - const [operation] = await client.batchTranslateText(request); + const [operation] = await client.batchTranslateText(request, options); // Wait for the operation to complete const [response] = await operation.promise(); diff --git a/translate/v3/translate_batch_translate_text_with_glossary_and_model.js b/translate/v3/translate_batch_translate_text_with_glossary_and_model.js index 68366162722..b208ea92882 100644 --- a/translate/v3/translate_batch_translate_text_with_glossary_and_model.js +++ b/translate/v3/translate_batch_translate_text_with_glossary_and_model.js @@ -68,8 +68,9 @@ function main( }; try { + const options = {timeout: 180000}; // Create a job using a long-running operation - const [operation] = await client.batchTranslateText(request); + const [operation] = await client.batchTranslateText(request, options); // Wait for operation to complete const [response] = await operation.promise(); diff --git a/translate/v3/translate_batch_translate_text_with_model.js b/translate/v3/translate_batch_translate_text_with_model.js index 884e9e9d601..9e2c0db7635 100644 --- a/translate/v3/translate_batch_translate_text_with_model.js +++ b/translate/v3/translate_batch_translate_text_with_model.js @@ -61,8 +61,9 @@ function main( }; try { + const options = {timeout: 180000}; // Create a job using a long-running operation - const [operation] = await client.batchTranslateText(request); + const [operation] = await client.batchTranslateText(request, options); // Wait for the operation to complete const [response] = await operation.promise();