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 18, 2018
1 parent bc9af98 commit 0d99929
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
3 changes: 1 addition & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ python:
- 3.5
- 3.6
- 3.7
- nightly
install:
- pip install -r requirements.txt
- pip install -r test-requirements.txt
Expand All @@ -24,4 +23,4 @@ before_script:
after_success:
- bash <(curl -s https://codecov.io/bash)
services:
- docker
- docker
7 changes: 5 additions & 2 deletions amqpstorm/channel.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,9 +112,12 @@ 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:
if break_on_empty:
break
self.check_for_errors()
if break_on_empty:
sleep(IDLE_WAIT * 10)
if not self._inbound:
break
continue
sleep(IDLE_WAIT)
continue
if to_tuple:
Expand Down

0 comments on commit 0d99929

Please sign in to comment.