8000 Update Region Tags by averikitsch · Pull Request #1532 · GoogleCloudPlatform/python-docs-samples · GitHub
[go: up one dir, main page]

Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions tasks/pull_queue_snippets.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@


def create_task(project, queue, location):
# [START tasks_create_task]
# [START cloud_tasks_create_task]
"""Create a task for a given queue with an arbitrary payload."""

from google.cloud import tasks_v2beta2
Expand All @@ -50,11 +50,11 @@ def create_task(project, queue, location):

print('Created task: {}'.format(response.name))
return response
# [END tasks_create_task]
# [END cloud_tasks_create_task]


def lease_task(project, queue, location):
# [START tasks_lease_and_acknowledge_task]
# [START cloud_tasks_lease_and_acknowledge_task]
"""Lease a single task from a given queue for 10 minutes."""

from google.cloud import tasks_v2beta2
Expand Down Expand Up @@ -89,7 +89,7 @@ def acknowledge_task(task):
client.acknowledge_task(task.name, task.schedule_time)

print('Acknowledged task {}'.format(task.name))
# [END tasks_lease_and_acknowledge_task]
# [END cloud_tasks_lease_and_acknowledge_task]


if __name__ == '__main__':
Expand Down
0