Skip to content

Commit

Permalink
Properly wait until the inbound queue is empty #63
Browse files Browse the repository at this point in the history
  • Loading branch information
eandersson committed Oct 17, 2018
1 parent bc9af98 commit a6418d7
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions amqpstorm/channel.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,10 +112,13 @@ def build_inbound_messages(self, break_on_empty=False, to_tuple=False,
while not self.is_closed:
message = self._build_message(auto_decode=auto_decode)
if not message:
sleep(IDLE_WAIT)
self.check_for_errors()
if break_on_empty:
sleep(IDLE_WAIT * 10)
if self._inbound:
continue
break
self.check_for_errors()
sleep(IDLE_WAIT)
continue
if to_tuple:
yield message.to_tuple()
Expand Down

0 comments on commit a6418d7

Please sign in to comment.