Merge "GerritWatcher: add poll_timeout"

This commit is contained in:
Jenkins 2016-05-16 22:52:07 +00:00 committed by Gerrit Code Review
commit 7c21047824
1 changed files with 2 additions and 1 deletions

View File

@ -132,6 +132,7 @@ class GerritEventConnector(threading.Thread):
class GerritWatcher(threading.Thread):
log = logging.getLogger("gerrit.GerritWatcher")
poll_timeout = 500
def __init__(self, gerrit_connection, username, hostname, port=29418,
keyfile=None):
@ -154,7 +155,7 @@ class GerritWatcher(threading.Thread):
poll = select.poll()
poll.register(stdout.channel)
while not self._stopped:
ret = poll.poll()
ret = poll.poll(self.poll_timeout)
for (fd, event) in ret:
if fd == stdout.channel.fileno():
if event == select.POLLIN: