Skip to content

Commit

Permalink
Merge pull request #176 from alpaker/total-rdy-update
Browse files Browse the repository at this point in the history
reader: Fix total_ready calculation in _send_rdy().
  • Loading branch information
mreiferson committed May 2, 2017
2 parents 2bae258 + 2b2f0ef commit ae4d6a5
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 ae4d6a5

Please sign in to comment.