diff options
author | Vineet Naik <vineet@helpshift.com> | 2015-06-29 20:29:49 +0530 |
---|---|---|
committer | David Pursehouse <david.pursehouse@sonymobile.com> | 2015-06-30 09:21:25 +0900 |
commit | f8f4df3621b650205870542b6114decb049e3477 (patch) | |
tree | ab57ccee14532a97b77355e31bce57db409f59d0 /pygerrit/client.py | |
parent | 964bed0993f1f01bd9eb5746ef26c089ad2a4369 (diff) | |
download | pygerrit-f8f4df3621b650205870542b6114decb049e3477.tar.gz |
Add keepalive support to GerritSSHClient
This will allow keeping the SSH sessions alive for a duration of time
longer than the timeout configured for the server.
Change-Id: I9d86c0fc304783fab944ebae7bd0da8f3b1edd6c
Diffstat (limited to 'pygerrit/client.py')
-rw-r--r-- | pygerrit/client.py | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/pygerrit/client.py b/pygerrit/client.py index 73f43be..733aa9a 100644 --- a/pygerrit/client.py +++ b/pygerrit/client.py @@ -40,14 +40,19 @@ class GerritClient(object): :arg str host: The hostname. :arg str username: (optional) The username to use when connecting. :arg str port: (optional) The port number to connect to. + :arg int keepalive: (optional) Keepalive interval in seconds. """ - def __init__(self, host, username=None, port=None): + def __init__(self, host, username=None, port=None, keepalive=None): self._factory = GerritEventFactory() self._events = Queue() self._stream = None - self._ssh_client = GerritSSHClient(host, username=username, port=port) + self.keepalive = keepalive + self._ssh_client = GerritSSHClient(host, + username=username, + port=port, + keepalive=keepalive) def gerrit_version(self): """ Get the Gerrit version. |