Skip to content

Commit

Permalink
docs: increase timeout on batch (#609)
Browse files Browse the repository at this point in the history
  • Loading branch information
munkhuushmgl authored and Ace Nassri committed Nov 17, 2022
1 parent f2993da commit 7d4d035
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 4 deletions.
6 changes: 5 additions & 1 deletion translate/v3/translate_batch_translate_text.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
3 changes: 2 additions & 1 deletion translate/v3/translate_batch_translate_text_with_glossary.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
3 changes: 2 additions & 1 deletion translate/v3/translate_batch_translate_text_with_model.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit 7d4d035

Please sign in to comment.