From d2b027e817c65a33214f337aae696e16a7e0c9b7 Mon Sep 17 00:00:00 2001 From: Stefan Midjich Date: Wed, 27 Jun 2018 10:28:55 +0200 Subject: [PATCH] take expire_hours from arguments --- portalclientlib/client.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/portalclientlib/client.py b/portalclientlib/client.py index be704f3..2e1f08d 100644 --- a/portalclientlib/client.py +++ b/portalclientlib/client.py @@ -22,10 +22,12 @@ class Client(object): self.ip_address = kw.pop('ip_address', '127.0.0.1') self.protocol = kw.pop('protocol', 'tcp') + expire_hours = kw.pop('expire_hours', 24) + self._enabled = False self._last_packets = 0 self._last_activity = None - self._expires = datetime.now() + timedelta(days=1) + self._expires = datetime.now() + timedelta(hours=expire_hours) self._new = False self._commit = False