2
0
mirror of https://opendev.org/x/pyghmi synced 2026-01-09 01:32:32 +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

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