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
4 changes: 2 additions & 2 deletions tasks/pull_queue_snippets.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ def create_task(project, queue, location):
# [END cloud_tasks_create_task]


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

Expand All @@ -90,7 +90,6 @@ def lease_task(project, queue, location):

print('Leased task {}'.format(response))
return response['tasks'][0]
# [END cloud_tasks_pull_task]


def acknowledge_task(task):
Expand All @@ -106,6 +105,7 @@ def acknowledge_task(task):
name=task['name'], body=body).execute()

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


if __name__ == '__main__':
Expand Down