Skip to content
Snippets Groups Projects
Commit 3b5bd3f9 authored by Antoine Millet's avatar Antoine Millet
Browse files

Fixed bug with AsyncWatcher and infinite timeout.

parent d4e2a4b6
No related branches found
No related tags found
No related merge requests found
...@@ -68,13 +68,13 @@ class AsyncWatcher(object): ...@@ -68,13 +68,13 @@ class AsyncWatcher(object):
>>> process(msg) >>> process(msg)
''' '''
responses = [] responses = []
time_remains = timeout
while self._expected_responses: while self._expected_responses:
try: try:
dt, response = self._get_in_queue(timeout=time_remains) dt, response = self._get_in_queue(timeout=timeout)
except Empty: except Empty:
break break
time_remains -= dt if timeout is not None:
timeout -= dt
responses.append(response) responses.append(response)
self._expected_responses.remove(response['id']) self._expected_responses.remove(response['id'])
# Check for max_wait: # Check for max_wait:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment