From 0c4b0bab54c29f154ca077b1c5ce966641dfd555 Mon Sep 17 00:00:00 2001 From: Nicholas Cook Date: Mon, 25 Jul 2022 18:53:49 -0700 Subject: [PATCH] docs(samples): fix timeout for LROs; first call can take up to 10 minutes (#82) Co-authored-by: Anthonios Partheniou --- video/livestream/create_channel.py | 2 +- video/livestream/create_channel_with_backup_input.py | 2 +- video/livestream/create_input.py | 2 +- video/livestream/delete_channel.py | 2 +- video/livestream/delete_input.py | 2 +- video/livestream/start_channel.py | 2 +- video/livestream/stop_channel.py | 2 +- video/livestream/update_channel.py | 2 +- video/livestream/update_input.py | 2 +- 9 files changed, 9 insertions(+), 9 deletions(-) diff --git a/video/livestream/create_channel.py b/video/livestream/create_channel.py index 67ed7fce7d41..5bb2326ebfb9 100644 --- a/video/livestream/create_channel.py +++ b/video/livestream/create_channel.py @@ -111,7 +111,7 @@ def create_channel( operation = client.create_channel( parent=parent, channel=channel, channel_id=channel_id ) - response = operation.result(60) + response = operation.result(600) print(f"Channel: {response.name}") return response diff --git a/video/livestream/create_channel_with_backup_input.py b/video/livestream/create_channel_with_backup_input.py index 0b7284b12fc9..5e49b7a88843 100644 --- a/video/livestream/create_channel_with_backup_input.py +++ b/video/livestream/create_channel_with_backup_input.py @@ -132,7 +132,7 @@ def create_channel_with_backup_input( operation = client.create_channel( parent=parent, channel=channel, channel_id=channel_id ) - response = operation.result(60) + response = operation.result(600) print(f"Channel: {response.name}") return response diff --git a/video/livestream/create_input.py b/video/livestream/create_input.py index ca5e3d6e318e..ab80f89e46ba 100644 --- a/video/livestream/create_input.py +++ b/video/livestream/create_input.py @@ -45,7 +45,7 @@ def create_input(project_id: str, location: str, input_id: str) -> str: type_="RTMP_PUSH", ) operation = client.create_input(parent=parent, input=input, input_id=input_id) - response = operation.result(60) + response = operation.result(600) print(f"Input: {response.name}") return response diff --git a/video/livestream/delete_channel.py b/video/livestream/delete_channel.py index 31dfa978b751..b7bd485358c6 100644 --- a/video/livestream/delete_channel.py +++ b/video/livestream/delete_channel.py @@ -39,7 +39,7 @@ def delete_channel(project_id: str, location: str, channel_id: str) -> None: name = f"projects/{project_id}/locations/{location}/channels/{channel_id}" operation = client.delete_channel(name=name) - operation.result(60) + operation.result(600) print("Deleted channel") diff --git a/video/livestream/delete_input.py b/video/livestream/delete_input.py index 55e895b38a32..fe74a6438d83 100644 --- a/video/livestream/delete_input.py +++ b/video/livestream/delete_input.py @@ -39,7 +39,7 @@ def delete_input(project_id: str, location: str, input_id: str) -> None: name = f"projects/{project_id}/locations/{location}/inputs/{input_id}" operation = client.delete_input(name=name) - operation.result(60) + operation.result(600) print("Deleted input") diff --git a/video/livestream/start_channel.py b/video/livestream/start_channel.py index b4f79d102c18..3d77cb5f09ee 100644 --- a/video/livestream/start_channel.py +++ b/video/livestream/start_channel.py @@ -39,7 +39,7 @@ def start_channel(project_id: str, location: str, channel_id: str) -> None: name = f"projects/{project_id}/locations/{location}/channels/{channel_id}" operation = client.start_channel(name=name) - operation.result(60) + operation.result(600) print("Started channel") diff --git a/video/livestream/stop_channel.py b/video/livestream/stop_channel.py index f580e37093f1..6440a8d7a972 100644 --- a/video/livestream/stop_channel.py +++ b/video/livestream/stop_channel.py @@ -39,7 +39,7 @@ def stop_channel(project_id: str, location: str, channel_id: str) -> None: name = f"projects/{project_id}/locations/{location}/channels/{channel_id}" operation = client.stop_channel(name=name) - operation.result(60) + operation.result(600) print("Stopped channel") diff --git a/video/livestream/update_channel.py b/video/livestream/update_channel.py index e4533c00425d..9bd25deb0cda 100644 --- a/video/livestream/update_channel.py +++ b/video/livestream/update_channel.py @@ -57,7 +57,7 @@ def update_channel( update_mask = field_mask.FieldMask(paths=["input_attachments"]) operation = client.update_channel(channel=channel, update_mask=update_mask) - response = operation.result(60) + response = operation.result(600) print(f"Updated channel: {response.name}") return response diff --git a/video/livestream/update_input.py b/video/livestream/update_input.py index 6b45bdea193b..64f2dfb19287 100644 --- a/video/livestream/update_input.py +++ b/video/livestream/update_input.py @@ -54,7 +54,7 @@ def update_input(project_id: str, location: str, input_id: str) -> str: update_mask = field_mask.FieldMask(paths=["preprocessing_config"]) operation = client.update_input(input=input, update_mask=update_mask) - response = operation.result(60) + response = operation.result(600) print(f"Updated input: {response.name}") return response