2
0
mirror of https://opendev.org/x/pyghmi synced 2025-01-27 19:37:44 +00:00

Merge "Provide a grace period for session validity"

This commit is contained in:
Zuul 2018-07-16 17:52:27 +00:00 committed by Gerrit Code Review
commit 571d70edc7

View File

@ -406,7 +406,7 @@ class Session(object):
with util.protect(KEEPALIVE_SESSIONS):
sess = cls.keepalive_sessions.get(session, None)
if sess is not None and 'timeout' in sess:
if sess['timeout'] < _monotonic_time():
if sess['timeout'] < _monotonic_time() - 15:
# session would have timed out by now, don't use it
return False
return True