Skip to content

Commit

Permalink
Print actual number of messages pulled (#2078)
Browse files Browse the repository at this point in the history
* Print actual number of messages pulled
  • Loading branch information
olivercoad authored and gguuss committed Aug 12, 2019
1 parent 67260e9 commit 1db16b8
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions pubsub/cloud-client/subscriber.py
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,8 @@ def synchronous_pull(project_id, subscription_name):
# Acknowledges the received messages so they will not be sent again.
subscriber.acknowledge(subscription_path, ack_ids)

print("Received and acknowledged {} messages. Done.".format(NUM_MESSAGES))
print('Received and acknowledged {} messages. Done.'.format(
len(response.received_messages)))
# [END pubsub_subscriber_sync_pull]


Expand Down Expand Up @@ -357,7 +358,8 @@ def worker(msg):
if processes:
time.sleep(SLEEP_TIME)

print("Received and acknowledged {} messages. Done.".format(NUM_MESSAGES))
print('Received and acknowledged {} messages. Done.'.format(
len(response.received_messages)))
# [END pubsub_subscriber_sync_pull_with_lease]


Expand Down

0 comments on commit 1db16b8

Please sign in to comment.