This is an automated email from the ASF dual-hosted git repository.

astitcher pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/qpid-proton.git

commit 5d769bc802ea72bc8f700449472705e904572cf3
Author: Andrew Stitcher <astitc...@apache.org>
AuthorDate: Wed Dec 19 22:54:33 2018 -0500

    PROTON-1985: [Python] Actually make default to listen forever
    - Bug in current behaviour such that default ends up throwing every message 
away
---
 python/examples/db_recv.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/python/examples/db_recv.py b/python/examples/db_recv.py
index 8c79049..ce27470 100755
--- a/python/examples/db_recv.py
+++ b/python/examples/db_recv.py
@@ -55,7 +55,7 @@ class Recv(MessagingHandler):
     def on_message(self, event):
         id = int(event.message.id)
         if (not self.last_id) or id > self.last_id:
-            if self.received < self.expected:
+            if self.expected == 0 or self.received < self.expected:
                 self.received += 1
                 self.last_id = id
                 self.db.insert(id, event.message.body, 
ApplicationEvent("record_inserted", delivery=event.delivery))


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@qpid.apache.org
For additional commands, e-mail: commits-h...@qpid.apache.org

Reply via email to