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