Skip to content

Commit

Permalink
reader: Fix total_ready calculation in _send_rdy(). Fixes nsqio#175.
Browse files Browse the repository at this point in the history
  • Loading branch information
Alp Aker committed May 1, 2017
1 parent 2bae258 commit bf2fef9
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion nsq/reader.py
Original file line number Diff line number Diff line change
Expand Up @@ -460,8 +460,9 @@ def _send_rdy(self, conn, value):
conn.rdy_timeout = self.io_loop.add_timeout(time.time() + 5, rdy_retry_callback)
return

new_rdy = max(self.total_rdy - conn.rdy + value, 0)
if conn.send_rdy(value):
self.total_rdy = max(self.total_rdy - conn.rdy + value, 0)
self.total_rdy = new_rdy

def connect_to_nsqd(self, host, port):
"""
Expand Down

0 comments on commit bf2fef9

Please sign in to comment.