Skip to content

Commit

Permalink
Fix subscription.open get called twice in the client libraries (#1321)
Browse files Browse the repository at this point in the history
  • Loading branch information
luxiangu authored and Jon Wayne Parrott committed Jan 17, 2018
1 parent fb0da4c commit 1bfa445
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions pubsub/cloud-client/subscriber.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,9 +124,8 @@ def callback(message):

# Blocks the thread while messages are coming in through the stream. Any
# exceptions that crop up on the thread will be set on the future.
future = subscription.open(callback)
try:
future.result()
subscription.future.result()
except Exception as e:
print(
'Listening for messages on {} threw an Exception: {}.'.format(
Expand Down

1 comment on commit 1bfa445

@anguillanneuf
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.