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 Dec 29, 2020
1 parent 0aafd26 commit 1f9f03a
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 1f9f03a

Please sign in to comment.